Skip to content

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

Open
yyyyaaa wants to merge 2 commits into
feat/headless-agent-kitfrom
feat/headless-constructive-cli
Open

yyyyaaa wants to merge 2 commits 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.

Needs inquirerer ^4.10.1 and @inquirerer/utils ^3.4.1 in packages/cli, both on npm.

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 commands that add, change
    or set up an agent need the person's stored sign-in, and refuse in their
    plan a sign-in from the CONSTRUCTIVE_* variables. agent grant of an agent
    that has the grant plans no change and sends nothing, and agent grant
    refuses, in its plan, an agent another backend issued; setup agent shows
    --organization in its plan, and refuses another organization for an
    agent that exists.
  • 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. Variables that api mutate reads from a file or stdin stay
    out of its plan, which holds a digest of them, so an approval applies
    only to the values the person saw the plan for.
  • 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.

whoami and status print key-value lines; db list, context list and agent
list print tables. A change the backend refuses under --as, from an agent
that may not change the schema, says so and gives the person agent grant.

Every change has a plan, which --dry-run shows with its id. The step after exit 3 or --dry-run is --approve , which applies that plan and no other; after plan-changed or not-approved, the next step is the same command with --dry-run, for the new plan. --yes stays for a script that shows no plan to anyone. 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.

@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

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@socket-security

socket-security Bot commented Nov 26, 2026 •

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
Added@​inquirerer/​utils@​3.4.19210010096100

View full report

@yyyyaaa
yyyyaaa force-pushed the feat/headless-constructive-cli branch from f47397e to f1242d2 Compare November 27, 2026 03:19
@yyyyaaa
yyyyaaa force-pushed the feat/headless-agent-kit branch from 2d6dbb6 to 57969c5 Compare November 27, 2026 03:19
@devin-ai-integration
devin-ai-integration Bot removed this pull request from stack #2096 November 27, 2026 18:30
@yyyyaaa
yyyyaaa force-pushed the feat/headless-agent-kit branch from 57969c5 to d5e7cc8 Compare November 28, 2026 14:45
@yyyyaaa
yyyyaaa force-pushed the feat/headless-constructive-cli branch from f1242d2 to b33f726 Compare November 28, 2026 14:45
@yyyyaaa
yyyyaaa force-pushed the feat/headless-agent-kit branch from d5e7cc8 to cbd6d9f Compare November 28, 2026 17:49
@yyyyaaa
yyyyaaa force-pushed the feat/headless-constructive-cli branch from b33f726 to 81c824d Compare November 28, 2026 17:49
@yyyyaaa
yyyyaaa marked this pull request as ready for review November 28, 2026 17:52
@yyyyaaa
yyyyaaa force-pushed the feat/headless-agent-kit branch from cbd6d9f to d43202b Compare November 28, 2026 17:53
@yyyyaaa
yyyyaaa force-pushed the feat/headless-constructive-cli branch from 81c824d to 40bf25c Compare November 28, 2026 17:53
@yyyyaaa
yyyyaaa force-pushed the feat/headless-agent-kit branch from d43202b to 13b1284 Compare November 28, 2026 18:39
@yyyyaaa
yyyyaaa force-pushed the feat/headless-constructive-cli branch from 40bf25c to 0cf7580 Compare November 28, 2026 18:39
… 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.
…tables for lists, diagrams in the topics

whoami and status print key-value lines, db list, context list and agent list
print tables, and dates print as days. The agent and setup plans are change
lists. A change refused under --as from an agent that may not change the schema
says so, and gives the person the grant. exit-codes, environment and files get
tables, approval a flow and agents a picture of who holds which key.

The approval topic, the exit codes, the agent notes and the README say that
the step after exit 3 or --dry-run is --approve <id>, which applies that plan
and no other; --yes stays for a script that shows no plan to anyone. A rerun
after a new agent token keeps --approve. The surface check allows the
merkle store options of the graph module, which the provisioning input takes.
@yyyyaaa
yyyyaaa force-pushed the feat/headless-agent-kit branch from 13b1284 to c3ef112 Compare November 28, 2026 19:03
@yyyyaaa
yyyyaaa force-pushed the feat/headless-constructive-cli branch from 0cf7580 to a8b2805 Compare November 28, 2026 19:04
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