iranti 0.2.23 → 0.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/scripts/iranti-cli.js +472 -88
- package/dist/scripts/iranti-mcp.js +1 -1
- package/dist/src/api/server.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -405,6 +405,8 @@ iranti install --scope user
|
|
|
405
405
|
- one or more project bindings
|
|
406
406
|
- optional Claude Code / Codex integration scaffolding
|
|
407
407
|
|
|
408
|
+
Operator-facing CLI help now includes short "what it does" and "use this when" guidance, so `iranti <command> --help` is the quickest way to choose the right entry point.
|
|
409
|
+
|
|
408
410
|
For automation:
|
|
409
411
|
- `iranti setup --defaults` uses sensible defaults plus environment/flag input, but still requires a real `DATABASE_URL`.
|
|
410
412
|
- `iranti setup --config <file>` reads a JSON setup plan for repeatable bootstrap.
|
|
@@ -5366,6 +5366,7 @@ async function handoffCommand(args) {
|
|
|
5366
5366
|
function printClaudeSetupHelp() {
|
|
5367
5367
|
console.log([
|
|
5368
5368
|
'Scaffold Claude Code MCP and hook files for the current project.',
|
|
5369
|
+
'Use this when a bound repo should be ready for Claude Code without hand-editing `.mcp.json` or `.claude/settings.local.json`.',
|
|
5369
5370
|
'',
|
|
5370
5371
|
'Usage:',
|
|
5371
5372
|
' iranti claude-setup [path] [--project-env <path>] [--force]',
|
|
@@ -5373,6 +5374,10 @@ function printClaudeSetupHelp() {
|
|
|
5373
5374
|
' iranti integrate claude [path] [--project-env <path>] [--force]',
|
|
5374
5375
|
' iranti integrate claude --scan <dir> [--recursive] [--force]',
|
|
5375
5376
|
'',
|
|
5377
|
+
'Typical scenarios:',
|
|
5378
|
+
' - One repo: run `iranti claude-setup .` from the project root after `iranti project init`.',
|
|
5379
|
+
' - Many repos: run `iranti claude-setup --scan <dir> --recursive` to scaffold every Claude-enabled project tree under a parent folder.',
|
|
5380
|
+
'',
|
|
5376
5381
|
'Notes:',
|
|
5377
5382
|
' - Expects a project binding at .env.iranti unless --project-env is supplied.',
|
|
5378
5383
|
' - Writes .mcp.json and .claude/settings.local.json.',
|
|
@@ -5610,71 +5615,283 @@ async function chatCommand(args) {
|
|
|
5610
5615
|
cwd: process.cwd(),
|
|
5611
5616
|
});
|
|
5612
5617
|
}
|
|
5618
|
+
function printHelpEntries(title, entries) {
|
|
5619
|
+
console.log(sectionTitle(title));
|
|
5620
|
+
for (const entry of entries) {
|
|
5621
|
+
console.log(` ${commandText(entry.command)}`);
|
|
5622
|
+
console.log(` What it does: ${entry.description}`);
|
|
5623
|
+
if (entry.useWhen) {
|
|
5624
|
+
console.log(` Use this when: ${entry.useWhen}`);
|
|
5625
|
+
}
|
|
5626
|
+
if (entry.scenario) {
|
|
5627
|
+
console.log(` Typical scenario: ${entry.scenario}`);
|
|
5628
|
+
}
|
|
5629
|
+
}
|
|
5630
|
+
console.log('');
|
|
5631
|
+
}
|
|
5632
|
+
function printOptionGuide(title, entries) {
|
|
5633
|
+
console.log(sectionTitle(title));
|
|
5634
|
+
for (const entry of entries) {
|
|
5635
|
+
console.log(` ${commandText(entry.option)}`);
|
|
5636
|
+
console.log(` What it means: ${entry.meaning}`);
|
|
5637
|
+
console.log(` Use this when: ${entry.useWhen}`);
|
|
5638
|
+
}
|
|
5639
|
+
console.log('');
|
|
5640
|
+
}
|
|
5613
5641
|
function printHelp() {
|
|
5614
5642
|
const rows = [
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5643
|
+
{
|
|
5644
|
+
command: 'iranti setup',
|
|
5645
|
+
description: 'Guided first-run setup for runtime root, database, instance, keys, and optional project binding.',
|
|
5646
|
+
useWhen: 'you are installing Iranti on a machine or want the CLI to walk you through the whole bootstrap path.',
|
|
5647
|
+
scenario: 'A fresh laptop or server where you want one command to get from zero to a runnable instance.',
|
|
5648
|
+
},
|
|
5649
|
+
{
|
|
5650
|
+
command: 'iranti run --instance local',
|
|
5651
|
+
description: 'Start a configured instance and record runtime metadata so status, restart, and health checks can see it.',
|
|
5652
|
+
useWhen: 'the instance already exists and you want the API server to actually start.',
|
|
5653
|
+
scenario: 'You finished setup or instance create/configure and now need the Iranti API listening on its port.',
|
|
5654
|
+
},
|
|
5655
|
+
{
|
|
5656
|
+
command: 'iranti doctor',
|
|
5657
|
+
description: 'Validate environment, database, provider keys, and runtime health before or after launch.',
|
|
5658
|
+
useWhen: 'something feels off, or before you trust a setup enough to hand it to Claude, Codex, or another client.',
|
|
5659
|
+
scenario: 'You changed provider keys, switched databases, or want a fast pass/fail diagnostic before debugging deeper.',
|
|
5660
|
+
},
|
|
5661
|
+
{
|
|
5662
|
+
command: 'iranti chat',
|
|
5663
|
+
description: 'Open the local Iranti chat shell against the configured runtime.',
|
|
5664
|
+
useWhen: 'you want an interactive sanity check or demo without writing client code first.',
|
|
5665
|
+
scenario: 'You just brought up an instance and want to confirm the runtime responds end to end.',
|
|
5666
|
+
},
|
|
5619
5667
|
];
|
|
5620
|
-
const printRows = (title, entries) => {
|
|
5621
|
-
console.log(sectionTitle(title));
|
|
5622
|
-
for (const [command, description] of entries) {
|
|
5623
|
-
console.log(` ${commandText(command)}`);
|
|
5624
|
-
console.log(` ${description}`);
|
|
5625
|
-
}
|
|
5626
|
-
console.log('');
|
|
5627
|
-
};
|
|
5628
5668
|
console.log(sectionTitle('Iranti CLI'));
|
|
5629
5669
|
console.log('Memory infrastructure for multi-agent systems.');
|
|
5630
5670
|
console.log('Most instance-aware commands also accept --root <path> in addition to --scope.');
|
|
5631
5671
|
console.log('Global debugging flags: --debug for extra diagnostics, --verbose for subprocess trace output.');
|
|
5632
5672
|
console.log('');
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5673
|
+
console.log('Run `iranti <command> --help` when you want the flag-by-flag version of this guidance.');
|
|
5674
|
+
console.log('');
|
|
5675
|
+
printHelpEntries('Start Here', rows);
|
|
5676
|
+
printHelpEntries('Setup And Runtime', [
|
|
5677
|
+
{
|
|
5678
|
+
command: 'iranti install [--scope user|system] [--root <path>]',
|
|
5679
|
+
description: 'Initialize runtime folders without doing the full guided setup flow.',
|
|
5680
|
+
useWhen: 'you want low-level control over the runtime root before creating instances manually.',
|
|
5681
|
+
scenario: 'Preparing a machine-level root ahead of scripted `instance create` calls.',
|
|
5682
|
+
},
|
|
5683
|
+
{
|
|
5684
|
+
command: 'iranti setup [--scope user|system] [--root <path>] [--mode isolated|shared] [--instance <name>] [--port <n>] [--config <file> | --defaults] [--db-mode local|managed|docker] [--db-url <url>] [--provider <name>] [--api-key <token>] [--projects <path1,path2>] [--claude-code] [--bootstrap-db]',
|
|
5685
|
+
description: 'Guided setup for runtime, database, instance, keys, and project binding.',
|
|
5686
|
+
useWhen: 'you want the CLI to explain the decisions and create a runnable starting point with minimal manual editing.',
|
|
5687
|
+
scenario: 'The normal first-run path for a developer machine, test box, or new local project.',
|
|
5688
|
+
},
|
|
5689
|
+
{
|
|
5690
|
+
command: 'iranti instance create <name> [--port 3001] [--db-url <url>] [--api-key <token>] [--provider <name>] [--provider-key <token>] [--scope user|system]',
|
|
5691
|
+
description: 'Create one instance directly without the setup wizard.',
|
|
5692
|
+
useWhen: 'you already know your database URL, port, and provider choices and want a scriptable primitive.',
|
|
5693
|
+
scenario: 'Provisioning multiple named instances under one runtime root.',
|
|
5694
|
+
},
|
|
5695
|
+
{
|
|
5696
|
+
command: 'iranti instance list [--scope user|system]',
|
|
5697
|
+
description: 'List configured instances under the active runtime root.',
|
|
5698
|
+
useWhen: 'you need to see what instances exist before showing, running, configuring, or binding one.',
|
|
5699
|
+
scenario: 'Checking whether `local`, `staging`, or another named instance already exists.',
|
|
5700
|
+
},
|
|
5701
|
+
{
|
|
5702
|
+
command: 'iranti instance show <name> [--scope user|system]',
|
|
5703
|
+
description: 'Show one instance env, port, database target, and runtime state.',
|
|
5704
|
+
useWhen: 'you are investigating one specific instance and need its exact configuration.',
|
|
5705
|
+
scenario: 'Confirming which port `local` uses before binding a project or debugging a runtime mismatch.',
|
|
5706
|
+
},
|
|
5707
|
+
{
|
|
5708
|
+
command: 'iranti instance restart <name> [--scope user|system] [--graceful-timeout <seconds>]',
|
|
5709
|
+
description: 'Restart a running instance using runtime metadata.',
|
|
5710
|
+
useWhen: 'the instance is already running and you changed env/config or installed a newer CLI/runtime.',
|
|
5711
|
+
scenario: 'Picking up a new provider key or new release without manually hunting the process.',
|
|
5712
|
+
},
|
|
5713
|
+
{
|
|
5714
|
+
command: 'iranti run --instance <name> [--scope user|system]',
|
|
5715
|
+
description: 'Start an instance and write runtime metadata.',
|
|
5716
|
+
useWhen: 'the instance exists on disk but the API process is not running yet.',
|
|
5717
|
+
scenario: 'Bringing `local` online after setup, reboot, or a stop/restart cycle.',
|
|
5718
|
+
},
|
|
5642
5719
|
]);
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5720
|
+
printHelpEntries('Configuration', [
|
|
5721
|
+
{
|
|
5722
|
+
command: 'iranti configure instance <name> [--interactive] [--db-url <url>] [--port <n>] [--api-key <token>] [--provider <name>] [--provider-key <token>] [--clear-provider-key] [--json]',
|
|
5723
|
+
description: 'Update an instance without editing env files manually.',
|
|
5724
|
+
useWhen: 'you need to change one existing instance after creation rather than recreate it from scratch.',
|
|
5725
|
+
scenario: 'Switching from `mock` to `openai`, rotating provider keys, or moving the instance to a new port.',
|
|
5726
|
+
},
|
|
5727
|
+
{
|
|
5728
|
+
command: 'iranti project init [path] --instance <name> [--api-key <token>] [--agent-id <id>] [--mode isolated|shared] [--force]',
|
|
5729
|
+
description: 'Create a new `.env.iranti` binding for one project.',
|
|
5730
|
+
useWhen: 'a repo should point at an Iranti instance for Claude, Codex, MCP, or direct SDK/API use.',
|
|
5731
|
+
scenario: 'Binding `iranti-control-plane` or another repo root to `local` so it can use shared memory.',
|
|
5732
|
+
},
|
|
5733
|
+
{
|
|
5734
|
+
command: 'iranti configure project [path] [--interactive] [--instance <name>] [--url <http://host:port>] [--api-key <token>] [--agent-id <id>] [--memory-entity <entity>] [--mode isolated|shared] [--json]',
|
|
5735
|
+
description: 'Refresh or retarget an existing project binding.',
|
|
5736
|
+
useWhen: 'the project is already bound and you want to change its instance, URL, key, agent identity, or memory entity.',
|
|
5737
|
+
scenario: 'Moving a repo from `local` to `shared_team` or fixing a wrong `IRANTI_PROJECT_MODE`.',
|
|
5738
|
+
},
|
|
5647
5739
|
]);
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5740
|
+
printHelpEntries('Keys', [
|
|
5741
|
+
{
|
|
5742
|
+
command: 'iranti auth create-key --instance <name> --key-id <id> --owner <owner> [--scopes kb:read,kb:write:project/*] [--description <text>] [--write-instance] [--project <path>] [--agent-id <id>] [--json]',
|
|
5743
|
+
description: 'Create or rotate an Iranti client key.',
|
|
5744
|
+
useWhen: 'a human, app, or project needs its own authenticated key for the Iranti API.',
|
|
5745
|
+
scenario: 'Issuing a project-scoped key during onboarding or rotating a leaked key.',
|
|
5746
|
+
},
|
|
5747
|
+
{
|
|
5748
|
+
command: 'iranti auth list-keys --instance <name> [--json]',
|
|
5749
|
+
description: 'List registry-backed Iranti client keys.',
|
|
5750
|
+
useWhen: 'you need to audit what keys exist before rotating or revoking them.',
|
|
5751
|
+
scenario: 'Checking whether a project already has a key before creating another one.',
|
|
5752
|
+
},
|
|
5753
|
+
{
|
|
5754
|
+
command: 'iranti auth revoke-key --instance <name> --key-id <id> [--json]',
|
|
5755
|
+
description: 'Revoke an Iranti client key.',
|
|
5756
|
+
useWhen: 'a key should stop working immediately because it is old, leaked, or no longer needed.',
|
|
5757
|
+
scenario: 'Removing access for a retired app or invalidating a compromised credential.',
|
|
5758
|
+
},
|
|
5759
|
+
{
|
|
5760
|
+
command: 'iranti list api-keys [--instance <name>] [--project <path>] [--json]',
|
|
5761
|
+
description: 'Show stored upstream provider keys.',
|
|
5762
|
+
useWhen: 'you need to see which providers are configured for an instance or bound project.',
|
|
5763
|
+
scenario: 'Checking whether `openai` or `claude` already has a stored key before switching providers.',
|
|
5764
|
+
},
|
|
5765
|
+
{
|
|
5766
|
+
command: 'iranti add api-key [provider] [--instance <name>] [--project <path>] [--key <token>] [--set-default] [--json]',
|
|
5767
|
+
description: 'Store a provider key and optionally make it the default.',
|
|
5768
|
+
useWhen: 'a provider is not configured yet and you want the instance to start using it.',
|
|
5769
|
+
scenario: 'Adding an OpenAI key after initial setup and making OpenAI the active provider.',
|
|
5770
|
+
},
|
|
5771
|
+
{
|
|
5772
|
+
command: 'iranti update api-key [provider] [--instance <name>] [--project <path>] [--key <token>] [--set-default] [--json]',
|
|
5773
|
+
description: 'Replace a stored provider key.',
|
|
5774
|
+
useWhen: 'the provider credential changed but the provider itself stays the same.',
|
|
5775
|
+
scenario: 'Rotating an expired Anthropic key without touching the rest of the instance config.',
|
|
5776
|
+
},
|
|
5777
|
+
{
|
|
5778
|
+
command: 'iranti remove api-key [provider] [--instance <name>] [--project <path>] [--json]',
|
|
5779
|
+
description: 'Remove a stored provider key.',
|
|
5780
|
+
useWhen: 'a provider should no longer be available from this instance or bound project.',
|
|
5781
|
+
scenario: 'Cleaning up an old Gemini credential after standardizing on OpenAI.',
|
|
5782
|
+
},
|
|
5656
5783
|
]);
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5784
|
+
printHelpEntries('Diagnostics And Operator Tools', [
|
|
5785
|
+
{
|
|
5786
|
+
command: 'iranti version',
|
|
5787
|
+
description: 'Print the installed CLI version and exit.',
|
|
5788
|
+
useWhen: 'you need to confirm which release is on PATH before debugging or upgrading.',
|
|
5789
|
+
scenario: 'Checking whether your global install picked up the latest npm release.',
|
|
5790
|
+
},
|
|
5791
|
+
{
|
|
5792
|
+
command: 'iranti doctor [--instance <name>] [--scope user|system] [--env <file>] [--json] [--debug]',
|
|
5793
|
+
description: 'Run environment and runtime diagnostics.',
|
|
5794
|
+
useWhen: 'you want a fast pass/fail check before doing deeper manual investigation.',
|
|
5795
|
+
scenario: 'Verifying database, provider key, and runtime readiness after setup or after a config change.',
|
|
5796
|
+
},
|
|
5797
|
+
{
|
|
5798
|
+
command: 'iranti status [--scope user|system] [--json]',
|
|
5799
|
+
description: 'Show runtime roots, bindings, and known instances.',
|
|
5800
|
+
useWhen: 'you need the operator overview: what root is active, what is bound, and what is actually running.',
|
|
5801
|
+
scenario: 'Understanding whether a project binding points at the same runtime root the CLI is inspecting.',
|
|
5802
|
+
},
|
|
5803
|
+
{
|
|
5804
|
+
command: 'iranti upgrade [--check] [--dry-run] [--yes] [--all] [--target auto|npm-global|npm-repo|python[,python]] [--json]',
|
|
5805
|
+
description: 'Check or run CLI/runtime/package upgrades.',
|
|
5806
|
+
useWhen: 'you want to see whether a newer npm or PyPI release exists or apply it safely.',
|
|
5807
|
+
scenario: 'Preparing to move a machine from `0.2.23` to the next patch release.',
|
|
5808
|
+
},
|
|
5809
|
+
{
|
|
5810
|
+
command: 'iranti uninstall [--dry-run] [--yes] [--all] [--keep-data] [--keep-project-bindings] [--scan-root <dir[,dir2]>] [--json]',
|
|
5811
|
+
description: 'Remove Iranti packages and, with `--all`, runtime data and project integrations.',
|
|
5812
|
+
useWhen: 'you are cleaning a machine up or resetting an install and want to control what gets preserved.',
|
|
5813
|
+
scenario: 'Removing the CLI from a machine while keeping project bindings, or doing a full wipe before reinstalling.',
|
|
5814
|
+
},
|
|
5815
|
+
{
|
|
5816
|
+
command: 'iranti handshake [--instance <name> | --project-env <file>] [--agent <id>] [--task <text>] [--recent <msg1||msg2>] [--recent-file <path>] [--json]',
|
|
5817
|
+
description: 'Manually inspect Attendant handshake output.',
|
|
5818
|
+
useWhen: 'you need to see what working-memory brief an agent would receive before a session starts.',
|
|
5819
|
+
scenario: 'Verifying that a project binding and agent identity resolve to the right memory context.',
|
|
5820
|
+
},
|
|
5821
|
+
{
|
|
5822
|
+
command: 'iranti attend [message] [--instance <name> | --project-env <file>] [--agent <id>] [--context <text> | --context-file <path>] [--entity-hint <entity>] [--force] [--max-facts <n>] [--json]',
|
|
5823
|
+
description: 'Manually inspect turn-level memory injection decisions.',
|
|
5824
|
+
useWhen: 'you want to debug why memory is or is not being injected for one specific prompt.',
|
|
5825
|
+
scenario: 'Investigating an agent turn where relevant facts were missing or too many facts were pulled in.',
|
|
5826
|
+
},
|
|
5827
|
+
{
|
|
5828
|
+
command: 'iranti handoff task/<task_id> [--instance <name> | --project-env <file>] [--agent <id>] --next-step <text> [--status <state>] [--owner <agent-id>] [--blockers <a||b>] [--artifacts <path1||path2>] [--project-entity <entity>] [--notes <text>] [--source <label>] [--confidence <n>] [--json]',
|
|
5829
|
+
description: 'Write a standardized shared-memory handoff for Claude/Codex collaboration.',
|
|
5830
|
+
useWhen: 'one tool or agent should leave structured next-step context for another tool or agent.',
|
|
5831
|
+
scenario: 'Claude finishes analysis and Codex needs a durable task handoff with blockers and artifacts.',
|
|
5832
|
+
},
|
|
5833
|
+
{
|
|
5834
|
+
command: 'iranti chat [--agent <agent-id>] [--provider <provider>] [--model <model>]',
|
|
5835
|
+
description: 'Open the local interactive chat shell.',
|
|
5836
|
+
useWhen: 'you want to talk to a live runtime directly from the terminal.',
|
|
5837
|
+
scenario: 'Quick sanity checking after setup without opening another client or UI.',
|
|
5838
|
+
},
|
|
5839
|
+
{
|
|
5840
|
+
command: 'iranti resolve [--dir <escalation-dir>]',
|
|
5841
|
+
description: 'Walk through pending escalation files.',
|
|
5842
|
+
useWhen: 'human review is required for unresolved conflicts in the escalation folder.',
|
|
5843
|
+
scenario: 'Cleaning up contradictions that the Librarian could not settle deterministically or with LLM reasoning.',
|
|
5844
|
+
},
|
|
5668
5845
|
]);
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5846
|
+
printHelpEntries('Integrations', [
|
|
5847
|
+
{
|
|
5848
|
+
command: 'iranti mcp [--help]',
|
|
5849
|
+
description: 'Start the stdio MCP server.',
|
|
5850
|
+
useWhen: 'Claude Code, Codex, or another MCP client should talk to Iranti over MCP instead of raw HTTP.',
|
|
5851
|
+
scenario: 'Registering Iranti as a tool source for Claude Code or Codex.',
|
|
5852
|
+
},
|
|
5853
|
+
{
|
|
5854
|
+
command: 'iranti claude-setup [path] [--project-env <path>] [--force]',
|
|
5855
|
+
description: 'Scaffold Claude Code files for one project.',
|
|
5856
|
+
useWhen: 'one bound repo should get `.mcp.json` and Claude hook files without hand-editing them.',
|
|
5857
|
+
scenario: 'Setting up `iranti-control-plane` so Claude Code can use the same Iranti instance.',
|
|
5858
|
+
},
|
|
5859
|
+
{
|
|
5860
|
+
command: 'iranti claude-setup --scan <dir> [--recursive] [--force]',
|
|
5861
|
+
description: 'Find Claude-enabled projects and scaffold them in batch.',
|
|
5862
|
+
useWhen: 'you have many repos and want to apply Claude scaffolding to all eligible ones under a parent directory.',
|
|
5863
|
+
scenario: 'Bootstrapping several repos in `C:\\Users\\NF\\Documents\\Projects` at once.',
|
|
5864
|
+
},
|
|
5865
|
+
{
|
|
5866
|
+
command: 'iranti claude-hook --event SessionStart|UserPromptSubmit [--project-env <path>] [--instance-env <path>] [--env-file <path>]',
|
|
5867
|
+
description: 'Run the Claude Code hook helper directly.',
|
|
5868
|
+
useWhen: 'you are debugging Claude hook behavior or invoking the hook outside normal Claude execution.',
|
|
5869
|
+
scenario: 'Testing whether the SessionStart hook can resolve the right project binding.',
|
|
5870
|
+
},
|
|
5871
|
+
{
|
|
5872
|
+
command: 'iranti codex-setup [--name iranti] [--agent codex_code] [--source Codex] [--provider openai] [--project-env <path>] [--local-script]',
|
|
5873
|
+
description: 'Register Iranti with the Codex CLI.',
|
|
5874
|
+
useWhen: 'Codex should see Iranti through its global MCP configuration.',
|
|
5875
|
+
scenario: 'Making the `codex` CLI able to call Iranti tools from bound repos.',
|
|
5876
|
+
},
|
|
5877
|
+
{
|
|
5878
|
+
command: 'iranti integrate claude [path] [--project-env <path>] [--force]',
|
|
5879
|
+
description: 'Alias for Claude setup.',
|
|
5880
|
+
useWhen: 'you prefer the integration verb but want the same behavior as `claude-setup`.',
|
|
5881
|
+
scenario: 'Scripting project setup with a more verb-oriented command name.',
|
|
5882
|
+
},
|
|
5883
|
+
{
|
|
5884
|
+
command: 'iranti integrate claude --scan <dir> [--recursive] [--force]',
|
|
5885
|
+
description: 'Alias for batch Claude setup.',
|
|
5886
|
+
useWhen: 'same as `claude-setup --scan`, but called through the integration command group.',
|
|
5887
|
+
scenario: 'Applying the same Claude scaffolding workflow under a directory tree.',
|
|
5888
|
+
},
|
|
5889
|
+
{
|
|
5890
|
+
command: 'iranti integrate codex [--name iranti] [--agent codex_code] [--source Codex] [--provider openai] [--project-env <path>] [--local-script]',
|
|
5891
|
+
description: 'Alias for Codex setup.',
|
|
5892
|
+
useWhen: 'same as `codex-setup`, but called through the integration command group.',
|
|
5893
|
+
scenario: 'Registering the Codex MCP server from a script that groups integrations under one verb.',
|
|
5894
|
+
},
|
|
5678
5895
|
]);
|
|
5679
5896
|
console.log(sectionTitle('Common Flows'));
|
|
5680
5897
|
console.log(` ${commandText('First install')}`);
|
|
@@ -5691,54 +5908,221 @@ function printHelp() {
|
|
|
5691
5908
|
console.log(` ${commandText('iranti add api-key openai --instance local --set-default')}`);
|
|
5692
5909
|
}
|
|
5693
5910
|
function printSetupHelp() {
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5911
|
+
printHelpEntries('Setup Command', [
|
|
5912
|
+
{
|
|
5913
|
+
command: 'iranti setup [--scope user|system] [--root <path>] [--mode isolated|shared] [--instance <name>] [--port <n>] [--config <file> | --defaults] [--db-mode local|managed|docker] [--db-url <url>] [--provider <name>] [--api-key <token>] [--projects <path1,path2>] [--claude-code] [--bootstrap-db]',
|
|
5914
|
+
description: 'Interactive or automation-friendly first-run setup for runtime, database, instance, provider keys, Iranti client key, and optional project bindings.',
|
|
5915
|
+
useWhen: 'you want one command to either explain setup choices interactively or execute a known setup plan non-interactively.',
|
|
5916
|
+
scenario: 'Bootstrapping a new project in isolated mode, or provisioning a shared runtime with multiple bound repos from a config file.',
|
|
5917
|
+
},
|
|
5918
|
+
]);
|
|
5919
|
+
printOptionGuide('Setup Option Guide', [
|
|
5920
|
+
{
|
|
5921
|
+
option: '--scope user|system',
|
|
5922
|
+
meaning: 'Selects the shared runtime install scope when you are not providing an explicit runtime root.',
|
|
5923
|
+
useWhen: 'you want the CLI to choose the usual user-level or system-level shared location for you.',
|
|
5924
|
+
},
|
|
5925
|
+
{
|
|
5926
|
+
option: '--root <path>',
|
|
5927
|
+
meaning: 'Pins setup to one explicit runtime root path instead of letting the CLI infer it.',
|
|
5928
|
+
useWhen: 'you want a deterministic isolated runtime folder or a custom shared runtime location.',
|
|
5929
|
+
},
|
|
5930
|
+
{
|
|
5931
|
+
option: '--mode isolated|shared',
|
|
5932
|
+
meaning: 'Chooses whether setup defaults to one-project-per-runtime (`isolated`) or one runtime shared across projects (`shared`).',
|
|
5933
|
+
useWhen: 'use `isolated` for one repo with its own memory/runtime boundary; use `shared` when multiple repos should intentionally point at the same instance.',
|
|
5934
|
+
},
|
|
5935
|
+
{
|
|
5936
|
+
option: '--instance <name>',
|
|
5937
|
+
meaning: 'Sets the instance name to create or update.',
|
|
5938
|
+
useWhen: 'you already know the instance name and do not want the wizard to prompt for it.',
|
|
5939
|
+
},
|
|
5940
|
+
{
|
|
5941
|
+
option: '--port <n>',
|
|
5942
|
+
meaning: 'Sets the API port for the instance.',
|
|
5943
|
+
useWhen: 'you need a predictable port or are avoiding a known port collision.',
|
|
5944
|
+
},
|
|
5945
|
+
{
|
|
5946
|
+
option: '--config <file>',
|
|
5947
|
+
meaning: 'Reads a JSON setup plan and executes it without asking questions.',
|
|
5948
|
+
useWhen: 'you want repeatable automation in CI, scripts, or documented team setup.',
|
|
5949
|
+
},
|
|
5950
|
+
{
|
|
5951
|
+
option: '--defaults',
|
|
5952
|
+
meaning: 'Runs setup non-interactively from flags plus environment/default values.',
|
|
5953
|
+
useWhen: 'you want quick automation but do not need the full explicitness of a saved config file.',
|
|
5954
|
+
},
|
|
5955
|
+
{
|
|
5956
|
+
option: '--db-mode local|managed|docker',
|
|
5957
|
+
meaning: 'Selects how PostgreSQL is sourced during automated setup.',
|
|
5958
|
+
useWhen: 'use `local` for your own postgres on the machine, `docker` for containerized local pgvector, or `managed` for a remote connection string you already own.',
|
|
5959
|
+
},
|
|
5960
|
+
{
|
|
5961
|
+
option: '--db-url <url>',
|
|
5962
|
+
meaning: 'Supplies the PostgreSQL connection string directly.',
|
|
5963
|
+
useWhen: 'you already know the target database and do not want the CLI to derive it.',
|
|
5964
|
+
},
|
|
5965
|
+
{
|
|
5966
|
+
option: '--provider <name>',
|
|
5967
|
+
meaning: 'Sets the default LLM provider for the instance.',
|
|
5968
|
+
useWhen: 'you want setup to land on `openai`, `claude`, `gemini`, `mock`, or another supported provider immediately.',
|
|
5969
|
+
},
|
|
5970
|
+
{
|
|
5971
|
+
option: '--api-key <token>',
|
|
5972
|
+
meaning: 'Supplies the instance `IRANTI_API_KEY` instead of generating or rotating one during setup.',
|
|
5973
|
+
useWhen: 'you need a predetermined client key because another system already expects it.',
|
|
5974
|
+
},
|
|
5975
|
+
{
|
|
5976
|
+
option: '--projects <path1,path2>',
|
|
5977
|
+
meaning: 'Binds one or more project roots during non-interactive setup.',
|
|
5978
|
+
useWhen: 'the setup flow should finish by writing `.env.iranti` into known repo folders.',
|
|
5979
|
+
},
|
|
5980
|
+
{
|
|
5981
|
+
option: '--claude-code',
|
|
5982
|
+
meaning: 'Also scaffold Claude Code MCP and hook files for bound projects during non-interactive setup.',
|
|
5983
|
+
useWhen: 'you want setup to leave each bound project immediately ready for Claude Code.',
|
|
5984
|
+
},
|
|
5985
|
+
{
|
|
5986
|
+
option: '--bootstrap-db',
|
|
5987
|
+
meaning: 'Runs migrations and seed steps after configuration when the target database is suitable.',
|
|
5988
|
+
useWhen: 'you want the database initialized right away and you know the target is a fresh or compatible pgvector-backed PostgreSQL database.',
|
|
5989
|
+
},
|
|
5990
|
+
]);
|
|
5701
5991
|
}
|
|
5702
5992
|
function printUninstallHelp() {
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5993
|
+
printHelpEntries('Uninstall Command', [
|
|
5994
|
+
{
|
|
5995
|
+
command: 'iranti uninstall [--scope user|system] [--root <path>] [--dry-run] [--yes] [--all] [--keep-data] [--keep-project-bindings] [--scan-root <dir[,dir2]>] [--json]',
|
|
5996
|
+
description: 'Remove the installed package and optionally remove runtime roots plus project integration files.',
|
|
5997
|
+
useWhen: 'you are intentionally cleaning up an Iranti install and want to choose between package-only removal and a full wipe.',
|
|
5998
|
+
scenario: 'Removing the CLI from a machine while keeping project bindings, or doing a clean reinstall with `--all`.',
|
|
5999
|
+
},
|
|
6000
|
+
]);
|
|
6001
|
+
printOptionGuide('Uninstall Option Guide', [
|
|
6002
|
+
{ option: '--dry-run', meaning: 'Shows what would be removed without deleting anything.', useWhen: 'you want to review the uninstall plan before confirming it.' },
|
|
6003
|
+
{ option: '--all', meaning: 'Also remove discovered runtime roots and project integration artifacts.', useWhen: 'you want a full cleanup instead of leaving instance data and bindings behind.' },
|
|
6004
|
+
{ option: '--keep-data', meaning: 'Preserve runtime roots even when `--all` is selected.', useWhen: 'you need a fresh package install later but want to keep the instance data on disk.' },
|
|
6005
|
+
{ option: '--keep-project-bindings', meaning: 'Preserve `.env.iranti` and related project integration files.', useWhen: 'projects should remain bound even though the CLI package is being removed.' },
|
|
6006
|
+
{ option: '--scan-root <dir[,dir2]>', meaning: 'Controls where the CLI looks for project bindings and isolated runtime roots.', useWhen: 'your repos live outside the usual home directory or you want a narrower cleanup scan.' },
|
|
6007
|
+
]);
|
|
5709
6008
|
}
|
|
5710
6009
|
function printInstanceHelp() {
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
6010
|
+
printHelpEntries('Instance Commands', [
|
|
6011
|
+
{
|
|
6012
|
+
command: 'iranti instance create <name> [--port 3001] [--db-url <url>] [--api-key <token>] [--provider <name>] [--provider-key <token>] [--scope user|system] [--root <path>]',
|
|
6013
|
+
description: 'Create one named instance under the active runtime root.',
|
|
6014
|
+
useWhen: 'you want a scriptable primitive instead of the setup wizard.',
|
|
6015
|
+
scenario: 'Creating `staging` next to `local` inside a shared runtime root.',
|
|
6016
|
+
},
|
|
6017
|
+
{
|
|
6018
|
+
command: 'iranti instance list [--scope user|system] [--root <path>]',
|
|
6019
|
+
description: 'List instance directories under the active runtime root.',
|
|
6020
|
+
useWhen: 'you need to discover what instances exist before managing them.',
|
|
6021
|
+
scenario: 'Checking whether the runtime root contains `local`, `demo`, or `shared_team`.',
|
|
6022
|
+
},
|
|
6023
|
+
{
|
|
6024
|
+
command: 'iranti instance show <name> [--scope user|system] [--root <path>]',
|
|
6025
|
+
description: 'Show one instance configuration and runtime state.',
|
|
6026
|
+
useWhen: 'you are troubleshooting one named instance and need its exact port, env file, and status.',
|
|
6027
|
+
scenario: 'Comparing the bound instance env with the runtime you think is running.',
|
|
6028
|
+
},
|
|
6029
|
+
{
|
|
6030
|
+
command: 'iranti instance restart <name> [--scope user|system] [--root <path>] [--graceful-timeout <seconds>]',
|
|
6031
|
+
description: 'Restart one running instance using runtime metadata.',
|
|
6032
|
+
useWhen: 'you changed configuration or upgraded Iranti and need the process to pick it up.',
|
|
6033
|
+
scenario: 'Restarting `local` after changing `LLM_PROVIDER` from `mock` to `openai`.',
|
|
6034
|
+
},
|
|
6035
|
+
]);
|
|
5716
6036
|
}
|
|
5717
6037
|
function printConfigureHelp() {
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
6038
|
+
printHelpEntries('Configure Commands', [
|
|
6039
|
+
{
|
|
6040
|
+
command: 'iranti configure instance <name> [--interactive] [--db-url <url>] [--port <n>] [--api-key <token>] [--provider <name>] [--provider-key <token>] [--clear-provider-key] [--scope user|system] [--root <path>] [--json]',
|
|
6041
|
+
description: 'Update one existing instance in place.',
|
|
6042
|
+
useWhen: 'you are changing a running or configured instance rather than creating a new one.',
|
|
6043
|
+
scenario: 'Updating the database URL, port, provider, or provider key for `local`.',
|
|
6044
|
+
},
|
|
6045
|
+
{
|
|
6046
|
+
command: 'iranti configure project [path] [--interactive] [--instance <name>] [--url <http://host:port>] [--api-key <token>] [--agent-id <id>] [--memory-entity <entity>] [--mode isolated|shared] [--scope user|system] [--root <path>] [--json]',
|
|
6047
|
+
description: 'Update one existing project binding.',
|
|
6048
|
+
useWhen: 'the project already has `.env.iranti` and should be retargeted or corrected.',
|
|
6049
|
+
scenario: 'Rebinding a repo from one instance to another or correcting the agent identity.',
|
|
6050
|
+
},
|
|
6051
|
+
]);
|
|
5721
6052
|
}
|
|
5722
6053
|
function printAuthHelp() {
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
6054
|
+
printHelpEntries('Auth Commands', [
|
|
6055
|
+
{
|
|
6056
|
+
command: 'iranti auth create-key --instance <name> --key-id <id> --owner <owner> [--scopes ...] [--description <text>] [--write-instance] [--project <path>] [--agent-id <id>] [--scope user|system] [--root <path>] [--json]',
|
|
6057
|
+
description: 'Create or rotate an Iranti client key.',
|
|
6058
|
+
useWhen: 'an app, project, or operator needs a durable authenticated credential for the Iranti API.',
|
|
6059
|
+
scenario: 'Issuing a new key for `iranti-control-plane` or rotating a leaked key ID.',
|
|
6060
|
+
},
|
|
6061
|
+
{
|
|
6062
|
+
command: 'iranti auth list-keys --instance <name> [--scope user|system] [--root <path>] [--json]',
|
|
6063
|
+
description: 'List registry-backed Iranti client keys.',
|
|
6064
|
+
useWhen: 'you need to inspect the existing auth surface before creating or revoking anything.',
|
|
6065
|
+
scenario: 'Auditing what keys exist for an instance before onboarding another project.',
|
|
6066
|
+
},
|
|
6067
|
+
{
|
|
6068
|
+
command: 'iranti auth revoke-key --instance <name> --key-id <id> [--scope user|system] [--root <path>] [--json]',
|
|
6069
|
+
description: 'Revoke an Iranti client key.',
|
|
6070
|
+
useWhen: 'a credential should stop working now because it is obsolete or compromised.',
|
|
6071
|
+
scenario: 'Removing access for a retired integration or suspected leaked token.',
|
|
6072
|
+
},
|
|
6073
|
+
]);
|
|
5727
6074
|
}
|
|
5728
6075
|
function printIntegrateHelp() {
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
6076
|
+
printHelpEntries('Integrations', [
|
|
6077
|
+
{
|
|
6078
|
+
command: 'iranti integrate claude [path] [--project-env <path>] [--force]',
|
|
6079
|
+
description: 'Alias for project-local Claude Code setup.',
|
|
6080
|
+
useWhen: 'you want the integration verb instead of the dedicated `claude-setup` command name.',
|
|
6081
|
+
scenario: 'Scaffolding one repo for Claude Code using the integration command group.',
|
|
6082
|
+
},
|
|
6083
|
+
{
|
|
6084
|
+
command: 'iranti integrate claude --scan <dir> [--recursive] [--force]',
|
|
6085
|
+
description: 'Alias for batch Claude Code setup.',
|
|
6086
|
+
useWhen: 'you want to scan a directory tree for Claude-enabled repos and scaffold them in one pass.',
|
|
6087
|
+
scenario: 'Applying Claude scaffolding across multiple repos under `Projects`.',
|
|
6088
|
+
},
|
|
6089
|
+
{
|
|
6090
|
+
command: 'iranti integrate codex [--name iranti] [--agent codex_code] [--source Codex] [--provider openai] [--project-env <path>] [--local-script]',
|
|
6091
|
+
description: 'Alias for Codex MCP setup.',
|
|
6092
|
+
useWhen: 'you want Codex integration but prefer the integration command group naming.',
|
|
6093
|
+
scenario: 'Registering Iranti with the global Codex MCP config.',
|
|
6094
|
+
},
|
|
6095
|
+
]);
|
|
5733
6096
|
}
|
|
5734
6097
|
function printProviderKeyHelp() {
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
6098
|
+
printHelpEntries('Provider Key Commands', [
|
|
6099
|
+
{
|
|
6100
|
+
command: 'iranti list api-keys [--instance <name>] [--project <path>] [--json]',
|
|
6101
|
+
description: 'List stored upstream provider keys.',
|
|
6102
|
+
useWhen: 'you need to see which remote providers are already configured.',
|
|
6103
|
+
scenario: 'Checking whether `openai` already has a stored key before adding or rotating one.',
|
|
6104
|
+
},
|
|
6105
|
+
{
|
|
6106
|
+
command: 'iranti add api-key [provider] [--instance <name>] [--project <path>] [--key <token>] [--set-default] [--json]',
|
|
6107
|
+
description: 'Add a new upstream provider key.',
|
|
6108
|
+
useWhen: 'a provider is not configured yet and should become available to the instance or project.',
|
|
6109
|
+
scenario: 'Adding a Claude key to an instance that was previously running on `mock` only.',
|
|
6110
|
+
},
|
|
6111
|
+
{
|
|
6112
|
+
command: 'iranti update api-key [provider] [--instance <name>] [--project <path>] [--key <token>] [--set-default] [--json]',
|
|
6113
|
+
description: 'Replace an existing provider key.',
|
|
6114
|
+
useWhen: 'the provider remains the same but the token changed.',
|
|
6115
|
+
scenario: 'Rotating an expired OpenAI key without changing the rest of the instance configuration.',
|
|
6116
|
+
},
|
|
6117
|
+
{
|
|
6118
|
+
command: 'iranti remove api-key [provider] [--instance <name>] [--project <path>] [--json]',
|
|
6119
|
+
description: 'Delete a stored provider key.',
|
|
6120
|
+
useWhen: 'a provider should no longer be usable from this instance or bound project.',
|
|
6121
|
+
scenario: 'Removing a Gemini credential after standardizing on another provider.',
|
|
6122
|
+
},
|
|
6123
|
+
]);
|
|
5741
6124
|
console.log(' Target either an instance env or a project binding. If neither is supplied, the CLI will try the current project first.');
|
|
6125
|
+
console.log(' Use instance targeting for shared runtime configuration. Use project targeting when the command should follow a specific `.env.iranti` binding.');
|
|
5742
6126
|
}
|
|
5743
6127
|
async function main() {
|
|
5744
6128
|
const args = parseArgs(process.argv.slice(2));
|
|
@@ -144,7 +144,7 @@ async function main() {
|
|
|
144
144
|
await ensureDefaultAgent(iranti);
|
|
145
145
|
const server = new mcp_js_1.McpServer({
|
|
146
146
|
name: 'iranti-mcp',
|
|
147
|
-
version: '0.2.
|
|
147
|
+
version: '0.2.24',
|
|
148
148
|
});
|
|
149
149
|
server.registerTool('iranti_handshake', {
|
|
150
150
|
description: `Initialize or refresh an agent's working-memory brief for the current task.
|
package/dist/src/api/server.js
CHANGED
|
@@ -41,7 +41,7 @@ const INSTANCE_DIR = process.env.IRANTI_INSTANCE_DIR?.trim()
|
|
|
41
41
|
const INSTANCE_RUNTIME_FILE = process.env.IRANTI_INSTANCE_RUNTIME_FILE?.trim()
|
|
42
42
|
|| (INSTANCE_DIR ? (0, runtimeLifecycle_1.runtimeFileForInstance)(INSTANCE_DIR) : null);
|
|
43
43
|
const INSTANCE_NAME = process.env.IRANTI_INSTANCE_NAME?.trim() || (INSTANCE_DIR ? path_1.default.basename(INSTANCE_DIR) : 'adhoc');
|
|
44
|
-
const VERSION = '0.2.
|
|
44
|
+
const VERSION = '0.2.24';
|
|
45
45
|
// M-18: Warn at startup if API key pepper is not set (important for production security)
|
|
46
46
|
if (!process.env.IRANTI_API_KEY_PEPPER) {
|
|
47
47
|
console.warn('[security] WARNING: IRANTI_API_KEY_PEPPER is not set. API key hashes have no pepper — set this env var in production.');
|