@indexnetwork/cli 0.10.2-rc.15.1 → 0.10.2-rc.16.1

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.
Files changed (2) hide show
  1. package/dist/index.js +159 -86
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -2938,91 +2938,164 @@ async function onboardingComplete(client, json) {
2938
2938
  // src/main.ts
2939
2939
  var DEFAULT_API_URL = "https://protocol.index.network";
2940
2940
  var DEFAULT_APP_URL = "https://index.network";
2941
- var VERSION = "0.10.0";
2942
- var HELP_TEXT = `
2943
- Index CLI v${VERSION}
2944
-
2945
- Usage:
2946
- index login Authenticate via browser (uses existing session or OAuth)
2947
- index login --token <token> Authenticate with a manually provided token
2948
- index logout Clear stored session
2949
- index conversation Chat with the AI agent (interactive REPL)
2950
- index conversation "message" One-shot message to the AI agent
2951
- index conversation --session <id> Resume a specific chat session
2952
- index conversation sessions List AI chat sessions
2953
- index conversation list List all conversations (H2A + H2H)
2954
- index conversation with <user-id> Open or resume a DM with a user
2955
- index conversation show <id> Show messages in a conversation
2956
- index conversation send <id> <msg> Send a message
2957
- index conversation stream Listen for real-time events (SSE)
2958
- index profile Show your profile
2959
- index profile show <user-id> Show another user's profile
2960
- index profile sync Regenerate your profile
2961
- index profile search <query> Search user profiles
2962
- index profile create [--linkedin <url>] [--github <url>] [--twitter <url>]
2963
- Create your profile from social URLs
2964
- index profile update <action> [--details <text>]
2965
- Update your profile
2966
- index intent list [--archived] [--limit <n>] List your signals
2967
- index intent show <id> Show signal details
2968
- index intent create <content> Create a signal from natural language
2969
- index intent update <id> <content> Update a signal's description
2970
- index intent archive <id> Archive a signal
2971
- index intent link <id> <network-id> Link a signal to a network
2972
- index intent unlink <id> <network-id> Unlink a signal from a network
2973
- index intent links <id> Show linked networks for a signal
2974
- index negotiation list List your agent's negotiations
2975
- index negotiation list --limit <n> Limit results
2976
- index negotiation list --since <t> Filter by time (ISO date or 1h, 2d, 1w)
2977
- index negotiation show <id> Show negotiation turn-by-turn details (accepts short ID)
2978
- index opportunity list List your opportunities
2979
- index opportunity list --status <s> Filter by status (pending|accepted|rejected|expired)
2980
- index opportunity list --limit <n> Limit results
2981
- index opportunity show <id> Show full opportunity details
2982
- index opportunity accept <id> Accept an opportunity
2983
- index opportunity reject <id> Reject an opportunity
2984
- index opportunity discover <query> Discover opportunities by search query
2985
- index network list List your networks
2986
- index network create <name> Create a new network
2987
- index network show <id> Show network details and members
2988
- index network update <id> [--title <t>] [--prompt <p>]
2989
- Update a network
2990
- index network delete <id> Delete a network
2991
- index network join <id> Join a public network
2992
- index network leave <id> Leave a network
2993
- index network invite <id> <email> Invite a user by email
2994
- index contact list List your contacts
2995
- index contact add <email> Add a contact by email
2996
- index contact remove <email> Remove a contact
2997
- index contact import --gmail Import contacts from Gmail
2998
- index scrape <url> Extract content from a URL
2999
- index onboarding complete Mark onboarding as complete
3000
- index sync Sync context to ~/.index/context.json
3001
- index sync --json Output synced context to stdout
3002
- index --help Show this help message
3003
- index --version Show version
3004
-
3005
- Options:
3006
- --api-url <url> Override the API server URL (default: ${DEFAULT_API_URL})
3007
- --app-url <url> Override the app URL for login (default: ${DEFAULT_APP_URL})
3008
- --token <token>, -t Provide a bearer token directly (skips browser flow)
3009
- --session <id>, -s Resume a specific chat session
3010
- --archived Include archived signals (intent list)
3011
- --status <status> Filter opportunities by status
3012
- --limit <n> Limit number of results
3013
- --since <date> Filter by time (ISO date or duration like 1h, 2d, 1w)
3014
- --json Output raw JSON instead of formatted text
3015
- --name <name> Name for contact add
3016
- --gmail Import source flag for contact import
3017
- --objective <text> Objective for scrape command
3018
- --target <uid> Target user for opportunity discover
3019
- --introduce <uid> Source user for introduction discovery
3020
- --linkedin <url> LinkedIn URL for profile create
3021
- --github <url> GitHub URL for profile create
3022
- --twitter <url> Twitter URL for profile create
3023
- --title <text> Title for network update
3024
- --details <text> Details for profile update
3025
- `;
2941
+ var VERSION = "0.10.2";
2942
+ var BOX = { tl: "╭", tr: "╮", bl: "╰", br: "╯", h: "─", v: "│" };
2943
+ function visualLen(s) {
2944
+ return stripAnsi(s).length;
2945
+ }
2946
+ function padVisual(s, width) {
2947
+ return s + " ".repeat(Math.max(0, width - visualLen(s)));
2948
+ }
2949
+ function panel(title, rows) {
2950
+ const innerW = Math.max(52, title.length + 4, ...rows.map((r) => visualLen(r)));
2951
+ const dashRun = Math.max(1, innerW - title.length - 3);
2952
+ const innerTop = `${BOX.h} ${title} ${BOX.h.repeat(dashRun)}`;
2953
+ console.log(`${GRAY}${BOX.tl}${innerTop}${BOX.tr}${RESET}`);
2954
+ for (const row of rows) {
2955
+ console.log(`${GRAY}${BOX.v}${RESET}${padVisual(row, innerW)}${GRAY}${BOX.v}${RESET}`);
2956
+ }
2957
+ console.log(`${GRAY}${BOX.bl}${BOX.h.repeat(innerW)}${BOX.br}${RESET}
2958
+ `);
2959
+ }
2960
+ function helpRowDim(leftW, left, right) {
2961
+ const pad = Math.max(0, leftW - left.length);
2962
+ return ` ${GRAY}${left}${" ".repeat(pad)} ${right}${RESET}`;
2963
+ }
2964
+ function helpRowCmd(leftW, left, right) {
2965
+ const pad = Math.max(0, leftW - left.length);
2966
+ return ` ${BOLD}${CYAN}${left}${RESET}${" ".repeat(pad)} ${right}`;
2967
+ }
2968
+ function helpRowCont(leftW, right) {
2969
+ return ` ${" ".repeat(leftW)} ${right}`;
2970
+ }
2971
+ function renderHelp() {
2972
+ const gsLefts = [
2973
+ "index login",
2974
+ "index login --token <token>",
2975
+ "index logout",
2976
+ 'index intent create "..."',
2977
+ "index negotiation list",
2978
+ "index opportunity list"
2979
+ ];
2980
+ const gsLW = Math.max(...gsLefts.map((s) => s.length));
2981
+ const formsLefts = [
2982
+ 'index conversation "message"',
2983
+ "index conversation --session <id>",
2984
+ "index sync --json",
2985
+ "index profile create",
2986
+ "index profile update",
2987
+ "index intent list",
2988
+ "index negotiation list",
2989
+ "index opportunity list",
2990
+ "index opportunity discover"
2991
+ ];
2992
+ const formsLW = Math.max(...formsLefts.map((s) => s.length));
2993
+ const cmdLefts = [
2994
+ "pattern",
2995
+ "example",
2996
+ "intent",
2997
+ "negotiation",
2998
+ "opportunity",
2999
+ "profile",
3000
+ "conversation",
3001
+ "network",
3002
+ "contact",
3003
+ "scrape",
3004
+ "sync",
3005
+ "onboarding"
3006
+ ];
3007
+ const cmdLW = Math.max(...cmdLefts.map((s) => s.length));
3008
+ const optLefts = [
3009
+ "--api-url <url>",
3010
+ "--app-url <url>",
3011
+ "--token <token>",
3012
+ "--session <id>",
3013
+ "--archived",
3014
+ "--status <status>",
3015
+ "--limit <n>",
3016
+ "--since <date>",
3017
+ "--json",
3018
+ "--name <name>",
3019
+ "--gmail",
3020
+ "--objective <text>",
3021
+ "--target <uid>",
3022
+ "--introduce <uid>",
3023
+ "--linkedin <url>",
3024
+ "--github <url>",
3025
+ "--twitter <url>",
3026
+ "--title <text>",
3027
+ "--details <text>",
3028
+ "--help",
3029
+ "--version"
3030
+ ];
3031
+ const optLW = Math.max(...optLefts.map((s) => s.length));
3032
+ console.log();
3033
+ console.log(` ${BOLD}${CYAN}I N D E X${RESET} ${GRAY}cli${RESET}`);
3034
+ console.log(` ${GRAY}v${VERSION}${RESET}
3035
+ `);
3036
+ panel("getting started", [
3037
+ helpRowCmd(gsLW, "index login", "authenticate via browser"),
3038
+ helpRowCmd(gsLW, "index login --token <token>", "authenticate with a bearer token"),
3039
+ helpRowCmd(gsLW, "index logout", "clear stored session"),
3040
+ helpRowCmd(gsLW, 'index intent create "..."', "describe what you're looking for"),
3041
+ helpRowCmd(gsLW, "index negotiation list", "see agent debates in progress"),
3042
+ helpRowCmd(gsLW, "index opportunity list", "see what was found for you")
3043
+ ]);
3044
+ panel("common forms", [
3045
+ helpRowCmd(formsLW, 'index conversation "message"', "send a one-shot agent message"),
3046
+ helpRowCmd(formsLW, "index conversation --session <id>", "resume an agent chat session"),
3047
+ helpRowCmd(formsLW, "index sync --json", "print synced context as JSON"),
3048
+ "",
3049
+ helpRowCmd(formsLW, "index profile create", "use social URL flags"),
3050
+ helpRowCmd(formsLW, "index profile update", "use action text or --details"),
3051
+ helpRowCmd(formsLW, "index intent list", "supports --archived and --limit"),
3052
+ helpRowCmd(formsLW, "index negotiation list", "supports --since and --limit"),
3053
+ helpRowCmd(formsLW, "index opportunity list", "supports --status and --limit"),
3054
+ helpRowCmd(formsLW, "index opportunity discover", "supports --target and --introduce")
3055
+ ]);
3056
+ panel("commands", [
3057
+ helpRowDim(cmdLW, "pattern", "index <command> [args] [options]"),
3058
+ helpRowDim(cmdLW, "example", 'index intent create "looking for a CTO"'),
3059
+ "",
3060
+ helpRowCmd(cmdLW, "intent", "list · show · create · update · archive"),
3061
+ helpRowCont(cmdLW, "link · unlink · links"),
3062
+ helpRowCmd(cmdLW, "negotiation", "list · show"),
3063
+ helpRowCmd(cmdLW, "opportunity", "list · show · accept · reject · discover"),
3064
+ "",
3065
+ helpRowCmd(cmdLW, "profile", "show · sync · search · create · update"),
3066
+ helpRowCmd(cmdLW, "conversation", "sessions · list · with · show · send · stream"),
3067
+ helpRowCmd(cmdLW, "network", "list · create · show · update · delete"),
3068
+ helpRowCont(cmdLW, "join · leave · invite"),
3069
+ helpRowCmd(cmdLW, "contact", "list · add · remove · import"),
3070
+ "",
3071
+ helpRowCmd(cmdLW, "scrape", "extract content from a URL"),
3072
+ helpRowCmd(cmdLW, "sync", "download your context locally"),
3073
+ helpRowCmd(cmdLW, "onboarding", "finish account setup")
3074
+ ]);
3075
+ panel("options", [
3076
+ helpRowDim(optLW, "--api-url <url>", "override API server URL"),
3077
+ helpRowDim(optLW, "--app-url <url>", "override app URL for login"),
3078
+ helpRowDim(optLW, "--token <token>", "provide bearer token directly"),
3079
+ helpRowDim(optLW, "--session <id>", "resume a chat session"),
3080
+ helpRowDim(optLW, "--archived", "include archived signals"),
3081
+ helpRowDim(optLW, "--status <status>", "filter opportunities by status"),
3082
+ helpRowDim(optLW, "--limit <n>", "limit number of results"),
3083
+ helpRowDim(optLW, "--since <date>", "filter by ISO date or duration"),
3084
+ helpRowDim(optLW, "--json", "output raw JSON"),
3085
+ helpRowDim(optLW, "--name <name>", "name for contact add"),
3086
+ helpRowDim(optLW, "--gmail", "import contacts from Gmail"),
3087
+ helpRowDim(optLW, "--objective <text>", "objective for scrape command"),
3088
+ helpRowDim(optLW, "--target <uid>", "target user for opportunity discovery"),
3089
+ helpRowDim(optLW, "--introduce <uid>", "source user for introduction discovery"),
3090
+ helpRowDim(optLW, "--linkedin <url>", "LinkedIn URL for profile create"),
3091
+ helpRowDim(optLW, "--github <url>", "GitHub URL for profile create"),
3092
+ helpRowDim(optLW, "--twitter <url>", "Twitter URL for profile create"),
3093
+ helpRowDim(optLW, "--title <text>", "title for network update"),
3094
+ helpRowDim(optLW, "--details <text>", "details for profile update"),
3095
+ helpRowDim(optLW, "--help", "show help for any command"),
3096
+ helpRowDim(optLW, "--version", "show version")
3097
+ ]);
3098
+ }
3026
3099
  async function requireAuth(apiUrlOverride) {
3027
3100
  const store = new CredentialStore;
3028
3101
  const creds = await store.load();
@@ -3086,7 +3159,7 @@ async function main() {
3086
3159
  const args = parseArgs(process.argv.slice(2));
3087
3160
  switch (args.command) {
3088
3161
  case "help":
3089
- console.log(HELP_TEXT);
3162
+ renderHelp();
3090
3163
  return;
3091
3164
  case "version":
3092
3165
  console.log(VERSION);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/cli",
3
- "version": "0.10.2-rc.15.1",
3
+ "version": "0.10.2-rc.16.1",
4
4
  "description": "Command-line interface for Index Network",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -20,10 +20,10 @@
20
20
  "publish:all": "bun scripts/publish.ts"
21
21
  },
22
22
  "optionalDependencies": {
23
- "@indexnetwork/cli-linux-x64": "0.10.2-rc.15.1",
24
- "@indexnetwork/cli-linux-arm64": "0.10.2-rc.15.1",
25
- "@indexnetwork/cli-darwin-x64": "0.10.2-rc.15.1",
26
- "@indexnetwork/cli-darwin-arm64": "0.10.2-rc.15.1"
23
+ "@indexnetwork/cli-linux-x64": "0.10.2-rc.16.1",
24
+ "@indexnetwork/cli-linux-arm64": "0.10.2-rc.16.1",
25
+ "@indexnetwork/cli-darwin-x64": "0.10.2-rc.16.1",
26
+ "@indexnetwork/cli-darwin-arm64": "0.10.2-rc.16.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/bun": "latest"