Skip to content

feat(cli)!: the constructive CLI uses the platform from a terminal or an agent - #2095

Draft
yyyyaaa wants to merge 1 commit into
feat/headless-agent-kitfrom
feat/headless-constructive-cli
Draft

yyyyaaa wants to merge 1 commit into
feat/headless-agent-kitfrom
feat/headless-constructive-cli

Conversation

@yyyyaaa

@yyyyaaa yyyyaaa commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes the implementation of constructive-io/constructive-planning#2588. Stack 3 of 3, on the agent kit PR.

After dev-utils publishes: inquirerer ^4.10.0 and @inquirerer/utils ^3.4.0 in packages/cli, and a new lockfile.

flowchart LR
  registry[node-type-registry] --> tools["@agentic-kit/db-tools + harness"]
  tools --> session["@agentic-kit/session"]
  tools --> mcp["@agentic-kit/mcp"]
  tools --> command["@agentic-kit/command"]
  session --> cli["constructive CLI"]
  mcp --> cli
  command --> cli
Loading

@constructive-io/cli 9.0.0 rebuilds the constructive (and cnc) CLI on
@agentic-kit/command, @agentic-kit/session, @agentic-kit/db-tools and
@agentic-kit/mcp:

  • Sign-in and backends: login, logout, whoami and status, and context
    list, add, use and remove, on the session store that the agent CLI and
    the desktop app share.
  • Agents: agent list, add, renew, grant, revoke and remove. A command acts
    as the person unless it says --as .
  • The database of the directory: db list, use, status, create, recreate
    and codegen. db create and db use write the binding to .env.
  • The schema and its rules: schema show; table add and delete; field add,
    update, retype and delete; relation add; blueprint apply; access types,
    explain, set and add; entity-type list, create and delete; template
    list, create, apply, update and delete. table add needs at least one
    --rule.
  • The API: api query, api mutate, api search and api describe, on a plane
    of the backend.
  • mcp serves the database tools on stdio: the read tools only, unless
    --write is given or the agent named by --as may change the schema and
    --read-only is not given. setup agent sets a project up for an agent
    host: an agent of the person, its name in the project binding, and the
    host's MCP entry with --read-only. Once the agent may change the schema
    (agent grant), only Claude Code's entry drops --read-only, because
    Claude Code asks the person before each write; the Codex and Cursor
    entries keep it, and the plan says how to take it out by hand.
  • An agent's key lasts 30 days. The CLI uses it to get a short-lived
    token and reuses that token until it ends. Whoever holds the key can
    act as the agent until the key ends, is renewed, or agent remove
    deletes the agent.
  • server, explorer and codegen keep their own flags.
  • Without a terminal, each next step of login and of the agent commands
    that needs a password carries --password-stdin.

help prints the CLI's help, a command's help, or one of seven topics
(environment, exit-codes, output, approval, agents, rules, files). The
build renders the reference to man/constructive.1 (and cnc.1) with
remark-man, and the package's man field installs them, so man
constructive works after npm i -g.

Every change has a plan, which --dry-run shows and --yes approves. Every
command has --schema, and --llms prints the command index. A test builds
the public surfaces (the manifest, the index, every --help and --schema,
the MCP instructions and tools, and all the text of the files npm packs
for the CLI, the agent CLI and their packages) and fails on internal
details.

BREAKING CHANGE: the 8.x commands are replaced. context create
--endpoint is context add --name , or login
--api-endpoint ; context current is context list or status; context
delete is context remove; auth set-token is login (email and password),
or CONSTRUCTIVE_USER_ID, CONSTRUCTIVE_ACCESS_TOKEN and
CONSTRUCTIVE_API_ENDPOINT for CI; auth status is whoami or status; auth
logout is logout; execute --query or --file is api query or api mutate.
Contexts and tokens stored under ~/.cnc are not read or migrated: add
each backend again with context add or login --api-endpoint. login makes
an API key that lasts 30 days; sign in again before it ends. After agent
grant, setup agent gives write tools only to Claude Code; the Codex and
Cursor entries keep --read-only. An agent's key lasts 30 days, and the
backend accepts it as the agent on any request until it ends, is renewed
or the agent is removed, so keep it in the 0600 store.

… an agent

@constructive-io/cli 9.0.0 rebuilds the constructive (and cnc) CLI on
@agentic-kit/command, @agentic-kit/session, @agentic-kit/db-tools and
@agentic-kit/mcp:
- Sign-in and backends: login, logout, whoami and status, and context
  list, add, use and remove, on the session store that the agent CLI and
  the desktop app share.
- Agents: agent list, add, renew, grant, revoke and remove. A command acts
  as the person unless it says --as <name>.
- The database of the directory: db list, use, status, create, recreate
  and codegen. db create and db use write the binding to .env.
- The schema and its rules: schema show; table add and delete; field add,
  update, retype and delete; relation add; blueprint apply; access types,
  explain, set and add; entity-type list, create and delete; template
  list, create, apply, update and delete. table add needs at least one
  --rule.
- The API: api query, api mutate, api search and api describe, on a plane
  of the backend.
- mcp serves the database tools on stdio: the read tools only, unless
  --write is given or the agent named by --as may change the schema and
  --read-only is not given. setup agent sets a project up for an agent
  host: an agent of the person, its name in the project binding, and the
  host's MCP entry with --read-only. Once the agent may change the schema
  (agent grant), only Claude Code's entry drops --read-only, because
  Claude Code asks the person before each write; the Codex and Cursor
  entries keep it, and the plan says how to take it out by hand.
- An agent's key lasts 30 days. The CLI uses it to get a short-lived
  token and reuses that token until it ends. Whoever holds the key can
  act as the agent until the key ends, is renewed, or agent remove
  deletes the agent.
- server, explorer and codegen keep their own flags.
- Without a terminal, each next step of login and of the agent commands
  that needs a password carries --password-stdin.

help prints the CLI's help, a command's help, or one of seven topics
(environment, exit-codes, output, approval, agents, rules, files). The
build renders the reference to man/constructive.1 (and cnc.1) with
remark-man, and the package's man field installs them, so man
constructive works after npm i -g.

Every change has a plan, which --dry-run shows and --yes approves. Every
command has --schema, and --llms prints the command index. A test builds
the public surfaces (the manifest, the index, every --help and --schema,
the MCP instructions and tools, and all the text of the files npm packs
for the CLI, the agent CLI and their packages) and fails on internal
details.

BREAKING CHANGE: the 8.x commands are replaced. context create <name>
--endpoint <url> is context add <api-endpoint> --name <name>, or login
--api-endpoint <url>; context current is context list or status; context
delete is context remove; auth set-token is login (email and password),
or CONSTRUCTIVE_USER_ID, CONSTRUCTIVE_ACCESS_TOKEN and
CONSTRUCTIVE_API_ENDPOINT for CI; auth status is whoami or status; auth
logout is logout; execute --query or --file is api query or api mutate.
Contexts and tokens stored under ~/.cnc are not read or migrated: add
each backend again with context add or login --api-endpoint. login makes
an API key that lasts 30 days; sign in again before it ends. After agent
grant, setup agent gives write tools only to Claude Code; the Codex and
Cursor entries keep --read-only. An agent's key lasts 30 days, and the
backend accepts it as the agent on any request until it ends, is renewed
or the agent is removed, so keep it in the 0600 store.
@yyyyaaa
yyyyaaa added this pull request to stack #2096 November 26, 2026 17:20
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedremark-man@​9.0.08010010083100
Addedunified@​11.0.510010010082100
Addedremark-parse@​11.0.010010010083100
Addedsmol-toml@​1.9.110010010086100

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant