Secani CLI
Work with your Secani ISMS from the terminal, in scripts and from coding agents.
The Secani CLI, secani, brings your risks, tasks, findings, controls and incidents to the terminal. People use it for quick lookups and changes, shell scripts read its JSON output, and coding agents such as Claude Code, Codex or Cursor can work with your ISMS without an MCP setup of their own. It talks to Secani MCP and has the same permissions as your account.
Install
npm install --global secaniOr run it without installing:
npx secani loginThe CLI needs Node.js 22.12 or newer and a Secani account. It is open source under the Apache-2.0 license: github.com/secani/cli.
Log in
secani loginThe CLI shows a login page and a code and opens the page in your browser. Sign in with your Secani account and confirm the code within five minutes. Over SSH or in a container, use secani login --no-open and open the page on any device.
The login is stored only for your user, in ~/.config/secani/auth.json (change the directory with SECANI_CONFIG_DIR), and renews itself. secani whoami shows the account and the current workspace, and secani logout removes the login from this computer.
The connection starts read-only. To create or change records, allow writes for Secani CLI in the Secani app under Settings > Integrations. The same page ends the connection.
Choose a workspace
secani workspaces list
secani workspaces switch acme/ismsWorkspaces are named <organization>/<workspace>. Pass --workspace acme/isms or set SECANI_WORKSPACE to choose one for a single command. With only one workspace, the CLI uses it automatically.
Commands
| Command | What it does |
|---|---|
secani login, logout, whoami | Log in and out, show the account and the current workspace |
secani workspaces list, switch | List workspaces and choose the current one |
secani risks list, inspect, create, update, delete | The risk register |
secani controls list, inspect | Controls (measures) |
secani findings list, inspect | Audit and assessment findings |
secani tasks list, inspect, create, update, archive, restore | Tasks |
secani incidents list, create, update | Security incidents |
secani search <query> | Assets, tasks, requirements and evidence |
secani tools list, inspect, call | Every tool of Secani MCP |
Every command explains its options with --help, and secani help search <words> finds the command for a task. Some examples:
secani tasks list --assignee me --open
secani risks list --min-level high
secani tasks update TASK-12 --status done
secani incidents create --title "Phishing mail opened" --severity high
secani search backup --framework "ISO 27001"Commands that work in a framework, such as creating a risk or searching requirements, take --framework with the framework's name or ID, or use the workspace's only framework.
Scripts and coding agents
--jsonprints exactly one JSON document and never asks a question. Lists return the records and apagination.nextcursor; changes return the record, anoutcomesuch ascreatedorupdated, and the command to inspect it.- Errors are a single JSON line on stderr with a stable
reason, for examplelogin_requiredormissing_workspace, andstatus: "action_required"when an input or a person's approval would let the command run. - Piped output is tab-separated with a header row and ISO times. A change piped elsewhere prints only the record's ID.
- Coding agents are recognized automatically: they never get prompts and always pass the workspace with
--workspaceorSECANI_WORKSPACE. - Deleting a risk, archiving a task and destructive MCP tools ask for confirmation. Without a terminal they need
--yes, which an agent should only add after a person has approved. - Every change carries an idempotency key. If the connection drops after a change was sent, the CLI prints the command to repeat it with
--request-id; Secani applies it at most once. --limitis the total number of results across pages, and--next <cursor>continues a list with the same filters.
Exit codes: 0 done (including empty results and no-ops), 1 failed, 2 usage error or missing input, 130 canceled.
Environment variables
| Variable | Effect |
|---|---|
SECANI_WORKSPACE | Workspace for every command; must match --workspace if both are set |
SECANI_TOKEN | An access token for Secani MCP instead of the stored login. Tokens are short-lived |
SECANI_CONFIG_DIR | Directory for the login and settings |
SECANI_ACCESSIBLE=1 | Plain words instead of symbols |
SECANI_GUIDANCE_DISABLED=1 | No optional next steps |
NO_COLOR, FORCE_COLOR | Turn color off or force it |
CI | Run without prompts |
Source and feedback
The CLI is developed in the open at github.com/secani/cli and published to npm as secani. Report bugs and ideas as GitHub issues, and security issues privately through the repository's Security tab.