Skip to main content
This page provides a comprehensive reference for all Frontier CLI commands, their flags, and usage examples.

Global Usage

frontier <command> <subcommand> [flags]

Server Commands

Manage Frontier server lifecycle, configuration, and database migrations.

server init

Initialize a new Frontier server configuration file.
frontier server init [flags]
--output
string
default:"./config.yaml"
Output path for the configuration file
Example:
frontier server init -o /etc/frontier/config.yaml

server start

Start the Frontier server.
frontier server start [flags]
--config
string
required
Path to the server configuration file
Examples:
frontier server start -c config.yaml
The server starts on port 8080 by default. Configure the port in your config file under app.port.

server migrate

Run database schema migrations.
frontier server migrate [flags]
--config
string
required
Path to the server configuration file containing database connection details
Example:
frontier server migrate -c config.yaml
This command:
  • Runs all pending database migrations
  • Populates default metadata schemas
  • Updates the schema version

server migrate-rollback

Rollback the last database migration.
frontier server migrate-rollback [flags]
--config
string
required
Path to the server configuration file
Example:
frontier server migrate-rollback -c config.yaml
This command rolls back only the most recent migration. Run multiple times to rollback further.

server keygen

Generate RSA keys in JWKS format for JWT token generation.
frontier server keygen [flags]
--keys
integer
default:"2"
Number of RSA key pairs to generate
Examples:
frontier server keygen

User Commands

Manage user accounts in Frontier.

user create

Create a new user.
frontier user create [flags]
--file
string
required
Path to JSON file containing user data
--header
string
required
Authentication header in format key:value
Request Body Format:
user.json
{
  "email": "[email protected]",
  "name": "john_doe",
  "title": "John Doe",
  "metadata": {
    "department": "engineering"
  }
}
Example:
frontier user create \
  --file user.json \
  --header X-Frontier-Email:[email protected]

user edit

Update an existing user.
frontier user edit <user-id> [flags]
user-id
string
required
User ID or slug to update
--file
string
required
Path to JSON file containing updated user data
Examples:
frontier user edit 9f256f86-31a3-11ec-8d3d-0242ac130003 -f user.json

user view

View details of a specific user.
frontier user view <user-id> [flags]
user-id
string
required
User ID or slug to view
--metadata
boolean
default:"false"
Include metadata in the output
Examples:
frontier user view 9f256f86-31a3-11ec-8d3d-0242ac130003

user list

List all users.
frontier user list
Example:
frontier user list

Organization Commands

Manage organizations.

organization create

Create a new organization.
frontier organization create [flags]
--file
string
required
Path to JSON file containing organization data
--header
string
required
Authentication header in format key:value
Request Body Format:
organization.json
{
  "name": "acme-corp",
  "title": "Acme Corporation",
  "metadata": {
    "industry": "technology",
    "size": "enterprise"
  }
}
Example:
frontier organization create \
  --file organization.json \
  --header X-Frontier-Email:[email protected]

organization edit

Update an existing organization.
frontier organization edit <organization-id> [flags]
organization-id
string
required
Organization ID to update
--file
string
required
Path to JSON file containing updated organization data
Example:
frontier organization edit org-123 -f organization.json

organization view

View details of a specific organization.
frontier organization view <organization-id> [flags]
organization-id
string
required
Organization ID to view
--metadata
boolean
default:"false"
Include metadata in the output
Examples:
frontier organization view org-123

organization list

List all organizations.
frontier organization list
Example:
frontier organization list

organization admlist

List administrators of an organization.
frontier organization admlist <organization-id>
organization-id
string
required
Organization ID to query
Example:
frontier organization admlist org-123

Project Commands

Manage projects within organizations.

project create

Create a new project.
frontier project create [flags]
--file
string
required
Path to JSON file containing project data
--header
string
required
Authentication header in format key:value
Request Body Format:
project.json
{
  "name": "backend-api",
  "title": "Backend API Project",
  "org_id": "org-123",
  "metadata": {
    "environment": "production"
  }
}
Example:
frontier project create \
  --file project.json \
  --header X-Frontier-Email:[email protected]

project edit

Update an existing project.
frontier project edit <project-id> [flags]
project-id
string
required
Project ID to update
--file
string
required
Path to JSON file containing updated project data
Example:
frontier project edit proj-456 -f project.json

project view

View details of a specific project.
frontier project view <project-id> [flags]
project-id
string
required
Project ID to view
--metadata
boolean
default:"false"
Include metadata in the output
Example:
frontier project view proj-456 --metadata

project list

List all projects in an organization.
frontier project list <org-id>
org-id
string
required
Organization ID to list projects from
Example:
frontier project list org-123

Group Commands

Manage user groups within organizations.

group create

Create a new group.
frontier group create [flags]
--file
string
required
Path to JSON file containing group data
--header
string
required
Authentication header in format key:value
Request Body Format:
group.json
{
  "name": "developers",
  "title": "Development Team",
  "org_id": "org-123",
  "metadata": {
    "team": "engineering"
  }
}
Example:
frontier group create \
  --file group.json \
  --header X-Frontier-Email:[email protected]

group edit

Update an existing group.
frontier group edit <group-id> [flags]
group-id
string
required
Group ID to update
--file
string
required
Path to JSON file containing updated group data
Example:
frontier group edit grp-789 -f group.json

group view

View details of a specific group.
frontier group view <org-id> <group-id> [flags]
org-id
string
required
Organization ID
group-id
string
required
Group ID to view
--metadata
boolean
default:"false"
Include metadata in the output
Example:
frontier group view org-123 grp-789 --metadata

group list

List all groups in an organization.
frontier group list <org-id>
org-id
string
required
Organization ID to list groups from
Example:
frontier group list org-123

Role Commands

Manage roles and their permissions.

role create

Create a new role.
frontier role create [flags]
--file
string
required
Path to JSON file containing role data
--header
string
required
Authentication header in format key:value
Request Body Format:
role.json
{
  "name": "developer",
  "title": "Developer Role",
  "permissions": [
    "app_project.read",
    "app_project.write"
  ],
  "org_id": "org-123",
  "metadata": {
    "level": "team"
  }
}
Example:
frontier role create \
  --file role.json \
  --header X-Frontier-Email:[email protected]

role edit

Update an existing role.
frontier role edit <role-id> [flags]
role-id
string
required
Role ID to update
--file
string
required
Path to JSON file containing updated role data
Example:
frontier role edit role-123 -f role.json

role view

View details of a specific role.
frontier role view <role-id> [flags]
role-id
string
required
Role ID to view
--metadata
boolean
default:"false"
Include metadata in the output
Example:
frontier role view role-123 --metadata

role list

List all roles.
frontier role list
Example:
frontier role list

Permission Commands

Manage permissions (also called actions).

permission create

Create new permissions.
frontier permission create [flags]
--file
string
required
Path to JSON file containing permission data
--header
string
required
Authentication header in format key:value
Request Body Format:
permission.json
{
  "name": "read",
  "namespace": "app_project",
  "metadata": {
    "description": "Read project data"
  }
}
Example:
frontier permission create \
  --file permission.json \
  --header X-Frontier-Email:[email protected]

permission edit

Update an existing permission.
frontier permission edit <permission-id> [flags]
permission-id
string
required
Permission ID to update
--file
string
required
Path to JSON file containing updated permission data
Example:
frontier permission edit perm-123 -f permission.json

permission view

View details of a specific permission.
frontier permission view <permission-id>
permission-id
string
required
Permission ID to view
Example:
frontier permission view perm-123

permission list

List all permissions.
frontier permission list
Example:
frontier permission list

Policy Commands

Manage authorization policies.

policy create

Create a new policy to grant a role to a principal on a resource.
frontier policy create [flags]
--file
string
required
Path to JSON file containing policy data
--header
string
required
Authentication header in format key:value
Request Body Format:
policy.json
{
  "role_id": "role-123",
  "resource": "app_project:proj-456",
  "principal": "app/user:user-789",
  "title": "Developer Access to Backend API"
}
Example:
frontier policy create \
  --file policy.json \
  --header X-Frontier-Email:[email protected]
Principal Format: Principals follow the format namespace:id, for example:
  • User: app/user:<user-id>
  • Group: app/group:<group-id>
  • Service User: app/serviceuser:<serviceuser-id>

policy edit

Update an existing policy.
frontier policy edit <policy-id> [flags]
policy-id
string
required
Policy ID to update
--file
string
required
Path to JSON file containing updated policy data
Example:
frontier policy edit pol-123 -f policy.json

policy view

View details of a specific policy.
frontier policy view <policy-id>
policy-id
string
required
Policy ID to view
Example:
frontier policy view pol-123

Namespace Commands

Manage permission namespaces.

namespace list

List all namespaces.
frontier namespace list
Example:
frontier namespace list

namespace view

View details of a specific namespace.
frontier namespace view <namespace-id>
namespace-id
string
required
Namespace ID to view
Example:
frontier namespace view app_project

Seed Command

Bootstrap Frontier with sample data.

seed

Populate the database with sample data including users, organizations, projects, groups, and resources.
frontier seed [flags]
--header
string
Authentication header key (value will be set to [email protected])
--config
string
Path to server configuration file (to read identity proxy header if —header not provided)
Examples:
frontier seed --header X-Frontier-Email
This command creates:
  • Custom permissions and roles
  • Sample users
  • Sample organizations with admins
  • Sample service users and credentials
  • Sample projects within organizations
  • Sample resources within projects
  • Sample policies granting access
The seed command uses [email protected] as the admin email. All created resources will be associated with this identity.

Preferences Commands

Manage platform and resource preferences.

preferences list

List all configured preferences.
frontier preferences list [flags]
--header
string
required
Authentication header in format key:value
Example:
frontier preferences list --header X-Frontier-Email:[email protected]

preferences set

Set a preference value.
frontier preferences set [flags]
--name
string
required
Name of the preference trait
--value
string
required
Value to set for the preference
--header
string
required
Authentication header in format key:value
Examples:
frontier preferences set \
  --name mail_link_subject \
  --value "Your Frontier login link" \
  --header X-Frontier-Email:[email protected]

preferences get

Get the list of available preference traits and their definitions.
frontier preferences get [flags]
--header
string
required
Authentication header in format key:value
Example:
frontier preferences get --header X-Frontier-Email:[email protected]

Config Commands

Manage CLI client configuration.

config init

Initialize a new client configuration file.
frontier config init
Example:
frontier config init
This creates a configuration file at the default location with the following structure:
host: http://localhost:8080

config list

Display the current client configuration.
frontier config list
Example:
frontier config list

Version Command

Display version information and check for updates.

version

Show the Frontier CLI version, build date, and commit.
frontier version
Example:
frontier version
Output:
Frontier: A secure and easy-to-use Authentication & Authorization Server
Version: v0.4.0
Build date: 2024-03-01
Commit: abc123def
The version command automatically checks for newer releases and notifies you if an update is available.

Global Flags

These flags are available across multiple commands:

Common Client Flags

--host
string
Frontier server host URL (can also be set in client config)Example: --host http://localhost:8080
--header
string
Authentication header in key:value formatExample: --header X-Frontier-Email:[email protected]
--file
string
Path to JSON file containing request bodyExample: --file user.json
--metadata
boolean
Include metadata in output (for view commands)Example: --metadata

Server Command Flags

--config
string
Path to server configuration fileExample: --config /etc/frontier/config.yaml

Help Topics

Frontier provides additional help documentation for specific topics.

Help Environment

View information about supported environment variables:
frontier help environment

Help Auth

View information about authentication configuration:
frontier help auth

Examples

Complete Workflow Example

Here’s a complete workflow for setting up a new organization with users and projects:
# Create organization
cat > org.json <<EOF
{
  "name": "acme-corp",
  "title": "Acme Corporation"
}
EOF

frontier organization create \
  -f org.json \
  -H X-Frontier-Email:[email protected]

Batch Operations Example

# List all users
frontier user list

# List all organizations
frontier organization list

# List projects in organization
frontier project list org-123

# List groups in organization
frontier group list org-123

# List all roles
frontier role list

# List all permissions
frontier permission list

Next Steps

CLI Overview

Learn about CLI capabilities and features

Installation

Install and configure the CLI

Shell Autocomplete

Enable command autocompletion

Build docs developers (and LLMs) love