@ariso-ai/ari-hooks 0.1.0 → 0.1.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 (3) hide show
  1. package/README.md +4 -5
  2. package/package.json +1 -1
  3. package/src/cli.js +14 -10
package/README.md CHANGED
@@ -15,7 +15,7 @@ npm install -g ari-hooks
15
15
  In any project folder where you use Claude Code:
16
16
 
17
17
  ```bash
18
- ari-hooks
18
+ ari-hooks install
19
19
  ```
20
20
 
21
21
  That single command:
@@ -33,9 +33,9 @@ Existing settings and hooks are preserved; running it again is a no-op.
33
33
 
34
34
  | Command | What it does |
35
35
  |---|---|
36
- | `ari-hooks` | Login (if needed) + set up hooks in the current folder |
36
+ | `ari-hooks install` | Login (if needed) + set up hooks in the current folder |
37
37
  | `ari-hooks login` | Browser login, stores the API token |
38
- | `ari-hooks init` | Just add the hooks to `./.claude/settings.json` |
38
+ | `ari-hooks init` | Just add the hooks to `./.claude/settings.json` (no login) |
39
39
  | `ari-hooks config` | Show configured URLs and login state |
40
40
  | `ari-hooks status` | Show login state |
41
41
  | `ari-hooks logout` | Delete the stored token |
@@ -44,8 +44,7 @@ Existing settings and hooks are preserved; running it again is a no-op.
44
44
 
45
45
  By default the CLI talks to production (`https://web.ari.ariso.ai` /
46
46
  `https://api.ari.ariso.ai`). To test against a local Ari stack, persist
47
- overrides with the URL flags (they work on any command, including bare
48
- `ari-hooks`):
47
+ overrides with the URL flags (they work on any command):
49
48
 
50
49
  ```bash
51
50
  ari-hooks config --web-url http://localhost:5173 --api-url http://localhost:4000
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariso-ai/ari-hooks",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Set up Claude Code hooks that share your requests and their outcomes with Ari",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -6,9 +6,9 @@ import { loadConfig, setUrls, showConfig } from './config.js';
6
6
  const USAGE = `ari-hooks — share your Claude Code activity with Ari
7
7
 
8
8
  Usage:
9
- ari-hooks Log in (if needed) and set up hooks in the current folder
9
+ ari-hooks install Log in (if needed) and set up hooks in the current folder
10
10
  ari-hooks login Log in via the browser and store an API token
11
- ari-hooks init Add the hooks to ./.claude/settings.json
11
+ ari-hooks init Just add the hooks to ./.claude/settings.json (no login)
12
12
  ari-hooks config Show the configured URLs and login state
13
13
  ari-hooks status Show login state
14
14
  ari-hooks logout Remove the stored token
@@ -63,22 +63,26 @@ export async function main(argv) {
63
63
  case 'config':
64
64
  showConfig();
65
65
  return;
66
+ case 'install': {
67
+ if (!loadConfig().token) {
68
+ await login();
69
+ }
70
+ init();
71
+ return;
72
+ }
66
73
  case 'init':
67
74
  init();
68
75
  return;
69
76
  case 'hook':
70
77
  await runHook(rest[1]);
71
78
  return;
72
- case undefined: {
73
- // Bare invocation: make "npx/global install run once in a folder"
74
- // the whole setup story. URL-only invocations (e.g. `ari-hooks
75
- // --web-url ...`) still run the full setup with the new URLs.
76
- if (!loadConfig().token) {
77
- await login();
79
+ case undefined:
80
+ // URL-only invocations (e.g. `ari-hooks --web-url ...`) are a
81
+ // complete action setUrls already printed the resulting config.
82
+ if (!flags.webUrl && !flags.apiUrl && !flags.resetUrls) {
83
+ console.log(USAGE);
78
84
  }
79
- init();
80
85
  return;
81
- }
82
86
  default:
83
87
  console.error(`Unknown command: ${command}\n`);
84
88
  console.log(USAGE);