@factorialco/fcode-cli
v1.1.1
Published
Factorial Code Command Line Interface
Readme
Factorial Code Command Line Interface
Factorial Code is the the all-in-one platform that connects your services and APIs in the most agile way. You may discover every single piece of the Factorial Code Universe in the following links:
Factorial Code provides both a Graphic User Interface (GUI), accessible at https://code.factorialhr.com, and a CLI for interacting with Factorial Code Cloud.
The Factorial Code Command Line Interface facilitates interaction with Factorial Code Cloud directly from your local workstation's command line. It's particularly useful if you prefer developing and testing processes' source code locally rather than using the web IDE of Factorial Code Cloud.
See full documentation at https://code.factorialhr.com/docs/cli/.
For a guide on writing and running tests for your processes, see TEST.md.
Usage
$ npm install -g @factorialco/fcode-cli
$ fcode COMMAND
running command...
$ fcode (--version)
@factorialco/fcode-cli/1.1.1 linux-x64 node-v22.22.3
$ fcode --help [COMMAND]
USAGE
$ fcode COMMAND
...Commands
fcode addfcode clone [TEAM]fcode dependencies:add [RESOURCESLUG]fcode dependencies:install [PROGRAMMINGLANGUAGE]fcode dependencies:pull [RESOURCESLUG]fcode dependencies:push [RESOURCESLUG]fcode dependencies:reset [RESOURCESLUG]fcode dependencies:status [RESOURCESLUG]fcode help [COMMAND]fcode httpfcode loginfcode logoutfcode modules:add [RESOURCESLUG]fcode modules:pull [RESOURCESLUG]fcode modules:push [RESOURCESLUG]fcode modules:remove [RESOURCESLUG]fcode modules:reset [RESOURCESLUG]fcode modules:status [RESOURCESLUG]fcode processes:add [RESOURCESLUG]fcode processes:install-dependencies [RESOURCESLUG]fcode processes:pull [RESOURCESLUG]fcode processes:push [RESOURCESLUG]fcode processes:remove [RESOURCESLUG]fcode processes:reset [RESOURCESLUG]fcode processes:status [RESOURCESLUG]fcode pullfcode pushfcode remote:add [TEAM]fcode remote:listfcode remote:set [TEAM]fcode resetfcode run SLUGfcode settings:get [KEY]fcode settings:remove KEYfcode settings:set KEY VALUEfcode setup-debugfcode statusfcode team:pullfcode team:pushfcode team:statusfcode test [SLUG]fcode test:scaffold SLUGfcode variables:add [RESOURCESLUG]fcode variables:pull [RESOURCESLUG]fcode variables:push [RESOURCESLUG]fcode variables:remove [RESOURCESLUG]fcode variables:reset [RESOURCESLUG]fcode variables:status [RESOURCESLUG]
fcode add
Keeps track of new local components
USAGE
$ fcode add
DESCRIPTION
Keeps track of new local components
EXAMPLES
$ fcode addfcode clone [TEAM]
Clone team workspace from cloud
USAGE
$ fcode clone [TEAM] [--skipSkillsSetup]
ARGUMENTS
[TEAM] Team name
FLAGS
--skipSkillsSetup Skip installation of the Factorial Code agent skills
DESCRIPTION
Clone team workspace from cloud
EXAMPLES
$ fcode clone
$ fcode clone [team]fcode dependencies:add [RESOURCESLUG]
Keeps track of dependencies
USAGE
$ fcode dependencies:add [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
Keeps track of dependencies
EXAMPLES
$ fcode dependencies:addfcode dependencies:install [PROGRAMMINGLANGUAGE]
Install Factorial Code dependencies
USAGE
$ fcode dependencies:install [PROGRAMMINGLANGUAGE] [-c] [-r] [-f]
ARGUMENTS
[PROGRAMMINGLANGUAGE] (all|javascript|python) [default: all] Programming language
FLAGS
-c, --check Check if is needed to install dependencies
-f, --force Force dependencies installation even if they are already installed
-r, --reset Remove all existing dependencies before installing
DESCRIPTION
Install Factorial Code dependencies
EXAMPLES
$ fcode dependencies:install [programmingLanguage]fcode dependencies:pull [RESOURCESLUG]
Fetch all dependencies from cloud and save them locally
USAGE
$ fcode dependencies:pull [RESOURCESLUG] [-f]
ARGUMENTS
[RESOURCESLUG] Resource slug
FLAGS
-f, --force Force command
DESCRIPTION
Fetch all dependencies from cloud and save them locally
EXAMPLES
$ fcode dependencies:pullfcode dependencies:push [RESOURCESLUG]
Update cloud dependencies with local ones
USAGE
$ fcode dependencies:push [RESOURCESLUG] [-f]
ARGUMENTS
[RESOURCESLUG] Resource slug
FLAGS
-f, --force Force command
DESCRIPTION
Update cloud dependencies with local ones
EXAMPLES
$ fcode dependencies:pushfcode dependencies:reset [RESOURCESLUG]
Reset dependencies with contents from current remote
USAGE
$ fcode dependencies:reset [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
Reset dependencies with contents from current remote
EXAMPLES
$ fcode dependencies:resetfcode dependencies:status [RESOURCESLUG]
List all dependencies status
USAGE
$ fcode dependencies:status [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
List all dependencies status
EXAMPLES
$ fcode dependencies:statusfcode help [COMMAND]
Display help for fcode.
USAGE
$ fcode help [COMMAND...] [-n]
ARGUMENTS
[COMMAND...] Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for fcode.See code: @oclif/plugin-help
fcode http
Start a local HTTP server to trigger Factorial Code processes via webhooks and expose forms schema
USAGE
$ fcode http [-P <value>] [-l DEBUG|INFO|WARNING|ERROR] [--auth-user <value>] [--auth-password <value>]
[-j]
FLAGS
-P, --port=<value> [default: 3000] Port to listen on
-j, --jsonLogs Output process logs as newline-delimited JSON (NDJSON)
-l, --logLevel=<option> [default: DEBUG] Log level to use in process executions
<options: DEBUG|INFO|WARNING|ERROR>
--auth-password=<value> Basic auth password
--auth-user=<value> Basic auth username
DESCRIPTION
Start a local HTTP server to trigger Factorial Code processes via webhooks and expose forms schema
EXAMPLES
$ fcode http
$ fcode http --port 8080
$ fcode http --auth-user admin --auth-password secretfcode login
Login with your Factorial Code credentials (browser OAuth or email/password)
USAGE
$ fcode login [-u <value>] [-a <value>] [-e <value>] [-p <value>] [-c <value>] [-s <value>] [-t <value>]
[-x]
FLAGS
-a, --authUrl=<value> Factorial Code Auth endpoint (including realm, ie:
https://code.factorialhr.com/auth/realms/fcode)). Only needed if auth domain is different
than used cloud endpoint
-c, --clientId=<value> Client ID (for oauth, to be used with Client Secret)
-e, --email=<value> Email (to be used with password)
-p, --password=<value> Password (to be used with email)
-s, --clientSecret=<value> Client Secret (for oauth, to be used with Client ID)
-t, --accessToken=<value> Access Token (to be used instead of email and password)
-u, --url=<value> [default: https://code.factorialhr.com/platform] Factorial Code Cloud endpoint (host or
full /platform URL, ie: code.factorialhr.com)
-x, --prompt Prompt for email and password (instead of opening browser)
DESCRIPTION
Login with your Factorial Code credentials (browser OAuth or email/password)
EXAMPLES
$ fcode login
$ fcode login --prompt
$ fcode login -e [email protected] -p your-passwordfcode logout
Logout from Factorial Code
USAGE
$ fcode logout [-u <value>]
FLAGS
-u, --url=<value> [default: https://code.factorialhr.com/platform] Factorial Code Cloud endpoint (host or full
/platform URL, ie: code.factorialhr.com)
DESCRIPTION
Logout from Factorial Code
EXAMPLES
$ fcode logoutfcode modules:add [RESOURCESLUG]
Keeps track of a new local module
USAGE
$ fcode modules:add [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
Keeps track of a new local module
EXAMPLES
$ fcode modules:addfcode modules:pull [RESOURCESLUG]
Fetch all modules from cloud and save them locally
USAGE
$ fcode modules:pull [RESOURCESLUG] [-f]
ARGUMENTS
[RESOURCESLUG] Resource slug
FLAGS
-f, --force Force command
DESCRIPTION
Fetch all modules from cloud and save them locally
EXAMPLES
$ fcode modules:pullfcode modules:push [RESOURCESLUG]
Update cloud modules with local ones
USAGE
$ fcode modules:push [RESOURCESLUG] [-f]
ARGUMENTS
[RESOURCESLUG] Resource slug
FLAGS
-f, --force Force command
DESCRIPTION
Update cloud modules with local ones
EXAMPLES
$ fcode modules:pushfcode modules:remove [RESOURCESLUG]
Remove track of local modules
USAGE
$ fcode modules:remove [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
Remove track of local modules
EXAMPLES
$ fcode modules:remove module-slugfcode modules:reset [RESOURCESLUG]
Reset modules with contents from current remote
USAGE
$ fcode modules:reset [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
Reset modules with contents from current remote
EXAMPLES
$ fcode modules:resetfcode modules:status [RESOURCESLUG]
List all modules status
USAGE
$ fcode modules:status [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
List all modules status
EXAMPLES
$ fcode modules:statusfcode processes:add [RESOURCESLUG]
Keeps track of a new local process
USAGE
$ fcode processes:add [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
Keeps track of a new local process
EXAMPLES
$ fcode processes:addfcode processes:install-dependencies [RESOURCESLUG]
Install Factorial Code process dependencies
USAGE
$ fcode processes:install-dependencies [RESOURCESLUG] [-c] [-r] [-f]
ARGUMENTS
[RESOURCESLUG] Resource slug
FLAGS
-c, --check Check if is needed to install dependencies
-f, --force Force dependencies installation even if they are already installed
-r, --reset Remove all existing dependencies before installing
DESCRIPTION
Install Factorial Code process dependencies
EXAMPLES
$ fcode processes:install-dependencies [processSlug]fcode processes:pull [RESOURCESLUG]
Fetch all processes from cloud and save them locally
USAGE
$ fcode processes:pull [RESOURCESLUG] [-f]
ARGUMENTS
[RESOURCESLUG] Resource slug
FLAGS
-f, --force Force command
DESCRIPTION
Fetch all processes from cloud and save them locally
EXAMPLES
$ fcode processes:pullfcode processes:push [RESOURCESLUG]
Update cloud processes with local ones
USAGE
$ fcode processes:push [RESOURCESLUG] [-f]
ARGUMENTS
[RESOURCESLUG] Resource slug
FLAGS
-f, --force Force command
DESCRIPTION
Update cloud processes with local ones
EXAMPLES
$ fcode processes:pushfcode processes:remove [RESOURCESLUG]
Remove track of local processes
USAGE
$ fcode processes:remove [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
Remove track of local processes
EXAMPLES
$ fcode process:remove process-slugfcode processes:reset [RESOURCESLUG]
Reset processes with contents from current remote
USAGE
$ fcode processes:reset [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
Reset processes with contents from current remote
EXAMPLES
$ fcode processes:resetfcode processes:status [RESOURCESLUG]
List all processes status
USAGE
$ fcode processes:status [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
List all processes status
EXAMPLES
$ fcode processes:statusfcode pull
Fetch from cloud team workspace and update local workspace
USAGE
$ fcode pull [-f]
FLAGS
-f, --force Force command
DESCRIPTION
Fetch from cloud team workspace and update local workspace
EXAMPLES
$ fcode pullfcode push
Update cloud team workspace with local workspace
USAGE
$ fcode push [-f]
FLAGS
-f, --force Force command
DESCRIPTION
Update cloud team workspace with local workspace
EXAMPLES
$ fcode pushfcode remote:add [TEAM]
Add a remote team workspace
USAGE
$ fcode remote:add [TEAM]
ARGUMENTS
[TEAM] Team name
DESCRIPTION
Add a remote team workspace
EXAMPLES
$ fcode remote:addfcode remote:list
List remote team workspaces
USAGE
$ fcode remote:list
DESCRIPTION
List remote team workspaces
EXAMPLES
$ fcode remote:listfcode remote:set [TEAM]
Set the active remote team workspace
USAGE
$ fcode remote:set [TEAM]
ARGUMENTS
[TEAM] Team name
DESCRIPTION
Set the active remote team workspace
EXAMPLES
$ fcode remote:set [team]fcode reset
Reset team workspace with contents from current remote
USAGE
$ fcode reset
DESCRIPTION
Reset team workspace with contents from current remote
EXAMPLES
$ fcode resetfcode run SLUG
Run Factorial Code processes locally
USAGE
$ fcode run SLUG [-p <value>] [-v <value>] [-l DEBUG|INFO|WARNING|ERROR] [-j] [-e <value>]
ARGUMENTS
SLUG Process slug
FLAGS
-e, --variablesFile=<value> Path to a .env file whose variables override workspace variables
-j, --jsonLogs Output process logs as newline-delimited JSON (NDJSON)
-l, --logLevel=<option> [default: DEBUG] Log level to use in process execution
<options: DEBUG|INFO|WARNING|ERROR>
-p, --parameters=<value> Parameters: stringified JSON or file path
-v, --version=<value> Process version
DESCRIPTION
Run Factorial Code processes locally
EXAMPLES
$ fcode run [process-slug]
$ fcode run --parameters ./parameters.json [process-slug]fcode settings:get [KEY]
Get a setting value or all settings
USAGE
$ fcode settings:get [KEY] [-a]
ARGUMENTS
[KEY] Setting key (optional, shows all settings if omitted)
FLAGS
-a, --all Show all settings including defaults
DESCRIPTION
Get a setting value or all settings
EXAMPLES
$ fcode settings:get disableUpdateNotifier
$ fcode settings:get
$ fcode settings:get --allfcode settings:remove KEY
Remove a setting value
USAGE
$ fcode settings:remove KEY
ARGUMENTS
KEY Setting key
DESCRIPTION
Remove a setting value
EXAMPLES
$ fcode settings:remove disableUpdateNotifierfcode settings:set KEY VALUE
Set a setting value
USAGE
$ fcode settings:set KEY VALUE
ARGUMENTS
KEY Setting key
VALUE Setting value
DESCRIPTION
Set a setting value
EXAMPLES
$ fcode settings:set disableUpdateNotifier true
$ fcode settings:set ignoreWorkspaceNotEmpty falsefcode setup-debug
Setup vscode debug configurations
USAGE
$ fcode setup-debug
DESCRIPTION
Setup vscode debug configurations
EXAMPLES
$ fcode setup-debugfcode status
Show team workspace status
USAGE
$ fcode status
DESCRIPTION
Show team workspace status
EXAMPLES
$ fcode statusfcode team:pull
Fetch team settings (timezone, error handler, inheritance) from cloud into team.json
USAGE
$ fcode team:pull
DESCRIPTION
Fetch team settings (timezone, error handler, inheritance) from cloud into team.json
EXAMPLES
$ fcode team:pullfcode team:push
Update cloud team settings (timezone, error handler, inheritance) from team.json
USAGE
$ fcode team:push [-f]
FLAGS
-f, --force Force command
DESCRIPTION
Update cloud team settings (timezone, error handler, inheritance) from team.json
EXAMPLES
$ fcode team:pushfcode team:status
Show whether team settings (timezone, error handler, inheritance) differ from the cloud
USAGE
$ fcode team:status
DESCRIPTION
Show whether team settings (timezone, error handler, inheritance) differ from the cloud
EXAMPLES
$ fcode team:statusfcode test [SLUG]
Run tests for Factorial Code processes
USAGE
$ fcode test [SLUG] [-l DEBUG|INFO|WARNING|ERROR] [-j]
ARGUMENTS
[SLUG] Process slug (omit to test all processes)
FLAGS
-j, --jsonLogs Output process logs as newline-delimited JSON (NDJSON)
-l, --logLevel=<option> [default: ERROR] Log level for process execution during tests
<options: DEBUG|INFO|WARNING|ERROR>
DESCRIPTION
Run tests for Factorial Code processes
EXAMPLES
$ fcode test
$ fcode test [process-slug]
$ fcode test --logLevel DEBUG [process-slug]fcode test:scaffold SLUG
Create a starter test structure for a process
USAGE
$ fcode test:scaffold SLUG
ARGUMENTS
SLUG Process slug to scaffold tests for
DESCRIPTION
Create a starter test structure for a process
EXAMPLES
$ fcode test:scaffold my-processfcode variables:add [RESOURCESLUG]
Keeps track of a new local variables
USAGE
$ fcode variables:add [RESOURCESLUG] [-s]
ARGUMENTS
[RESOURCESLUG] Resource slug
FLAGS
-s, --sensitive Add variable as sensitive
DESCRIPTION
Keeps track of a new local variables
EXAMPLES
$ fcode variables:addfcode variables:pull [RESOURCESLUG]
Fetch all variables from cloud and save them locally
USAGE
$ fcode variables:pull [RESOURCESLUG] [-f]
ARGUMENTS
[RESOURCESLUG] Resource slug
FLAGS
-f, --force Force command
DESCRIPTION
Fetch all variables from cloud and save them locally
EXAMPLES
$ fcode variables:pullfcode variables:push [RESOURCESLUG]
Create cloud variables from local ones
USAGE
$ fcode variables:push [RESOURCESLUG] [-f]
ARGUMENTS
[RESOURCESLUG] Resource slug
FLAGS
-f, --force Force command
DESCRIPTION
Create cloud variables from local ones
EXAMPLES
$ fcode variables:pushfcode variables:remove [RESOURCESLUG]
Remove track of local variables
USAGE
$ fcode variables:remove [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
Remove track of local variables
EXAMPLES
$ fcode variables:remove variable-slugfcode variables:reset [RESOURCESLUG]
Reset variables with contents from current remote
USAGE
$ fcode variables:reset [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
Reset variables with contents from current remote
EXAMPLES
$ fcode variables:resetfcode variables:status [RESOURCESLUG]
List all variables status
USAGE
$ fcode variables:status [RESOURCESLUG]
ARGUMENTS
[RESOURCESLUG] Resource slug
DESCRIPTION
List all variables status
EXAMPLES
$ fcode variables:status