Skip to Content
SecaniDocumentation

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 secani

Or run it without installing:

npx secani login

The 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 login

The 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/isms

Workspaces 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

CommandWhat it does
secani login, logout, whoamiLog in and out, show the account and the current workspace
secani workspaces list, switchList workspaces and choose the current one
secani risks list, inspect, create, update, deleteThe risk register
secani controls list, inspectControls (measures)
secani findings list, inspectAudit and assessment findings
secani tasks list, inspect, create, update, archive, restoreTasks
secani incidents list, create, updateSecurity incidents
secani search <query>Assets, tasks, requirements and evidence
secani tools list, inspect, callEvery 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

  • --json prints exactly one JSON document and never asks a question. Lists return the records and a pagination.next cursor; changes return the record, an outcome such as created or updated, and the command to inspect it.
  • Errors are a single JSON line on stderr with a stable reason, for example login_required or missing_workspace, and status: "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 --workspace or SECANI_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.
  • --limit is 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

VariableEffect
SECANI_WORKSPACEWorkspace for every command; must match --workspace if both are set
SECANI_TOKENAn access token for Secani MCP instead of the stored login. Tokens are short-lived
SECANI_CONFIG_DIRDirectory for the login and settings
SECANI_ACCESSIBLE=1Plain words instead of symbols
SECANI_GUIDANCE_DISABLED=1No optional next steps
NO_COLOR, FORCE_COLORTurn color off or force it
CIRun 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.