cardinal-ai 0.2.9 → 0.2.11
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.
- checksums.yaml +4 -4
- data/README.md +17 -1
- data/exe/cardinal +34 -3
- data/lib/cardinal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d84dde8c38e1b5d9819430f36789358dcccd571d7889c36555156a8fbf882172
|
|
4
|
+
data.tar.gz: 69720ca8ec6c5ad490d863d9fabe4636ef67f465fa028fe2d27c2949ed9ccb86
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e3d7f706dbab0ec9b06a22ee2fa547ded9690b45b2faeb0e3582b78dc893ba7599ae9c5ada2fd5e9e6b88b11f1445dbc2528c76fd4cbe2879e413761af8a82b7
|
|
7
|
+
data.tar.gz: 722fd734f542aed1c45af13226a8d233af66b0dc47e719f3b5efc85b02b0917e80e7bbb5239399bc326b814877d7af044ec3b3af8214e780b59f6a15503e119f
|
data/README.md
CHANGED
|
@@ -20,9 +20,22 @@ merged. You never leave the board.
|
|
|
20
20
|
gem install cardinal-ai
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
**If `cardinal` says "command not found" afterwards:** on many systems (Arch, Fedora,
|
|
24
|
+
any install without sudo) gems land in a per-user folder your shell doesn't look in —
|
|
25
|
+
the install output even warns about it, easy to miss. Add it to your PATH once:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
# bash / zsh — add to ~/.bashrc or ~/.zshrc:
|
|
29
|
+
export PATH="$(ruby -e 'puts Gem.user_dir')/bin:$PATH"
|
|
30
|
+
|
|
31
|
+
# fish — run once, it sticks:
|
|
32
|
+
fish_add_path (ruby -e 'puts Gem.user_dir')/bin
|
|
33
|
+
```
|
|
34
|
+
|
|
23
35
|
## Use it
|
|
24
36
|
|
|
25
|
-
Go to any project
|
|
37
|
+
Go to any project and start Cardinal (a brand-new folder is fine — it offers to
|
|
38
|
+
`git init` for you):
|
|
26
39
|
|
|
27
40
|
```sh
|
|
28
41
|
cd your-project
|
|
@@ -32,6 +45,9 @@ cardinal
|
|
|
32
45
|
The first time, a browser window asks **which Claude account this board should work as** —
|
|
33
46
|
pick one, and it's remembered for this project only. Then open **http://localhost:4000**.
|
|
34
47
|
|
|
48
|
+
Running boards on two projects at once? Give the second one its own port:
|
|
49
|
+
`cardinal 4001` (or `-p 4001`).
|
|
50
|
+
|
|
35
51
|
That's the whole setup. Now:
|
|
36
52
|
|
|
37
53
|
1. **Add a card** for something you want done, in plain English.
|
data/exe/cardinal
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# cardinal — spin up a Cardinal AI board for the repo you're standing in.
|
|
5
5
|
#
|
|
6
6
|
# cardinal # or `cardinal up` — first run links a Claude account
|
|
7
|
+
# cardinal 4001 # same, on a different port (also: -p/--port 4001)
|
|
7
8
|
# cardinal login # redo the account link (switch accounts)
|
|
8
9
|
# cardinal logout # unlink this instance's account
|
|
9
10
|
#
|
|
@@ -22,8 +23,38 @@ TOKEN_FILE = File.join(AUTH_DIR, "oauth-token")
|
|
|
22
23
|
def say(msg) = puts("cardinal ▸ #{msg}")
|
|
23
24
|
def die(msg) = abort("cardinal: #{msg}")
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
# Port: `cardinal 4001`, `-p 4001`, `--port 4001`, or `--port=4001`.
|
|
27
|
+
# Explicit choice beats the PORT env var; default (4000) is applied later.
|
|
28
|
+
args = ARGV.dup
|
|
29
|
+
port = nil
|
|
30
|
+
if (i = args.index("-p") || args.index("--port"))
|
|
31
|
+
args.delete_at(i)
|
|
32
|
+
port = args.delete_at(i) or die("#{ARGV[i]} needs a port number")
|
|
33
|
+
elsif (flag = args.find { |a| a.start_with?("--port=") })
|
|
34
|
+
args.delete(flag)
|
|
35
|
+
port = flag.split("=", 2).last
|
|
36
|
+
elsif (bare = args.find { |a| a.match?(/\A\d+\z/) })
|
|
37
|
+
args.delete(bare)
|
|
38
|
+
port = bare
|
|
39
|
+
end
|
|
40
|
+
die "invalid port: #{port}" if port && !port.match?(/\A\d+\z/)
|
|
41
|
+
ENV["PORT"] = port if port
|
|
42
|
+
|
|
43
|
+
cmd = args[0] || "up"
|
|
44
|
+
unless File.directory?(File.join(TARGET, ".git"))
|
|
45
|
+
# A brand-new project shouldn't need ceremony — cards are branches and PRs,
|
|
46
|
+
# so a repo must exist, but Cardinal can lay that rail itself.
|
|
47
|
+
if cmd == "up" && $stdin.tty?
|
|
48
|
+
print "cardinal ▸ #{TARGET} isn't a git repository yet — initialize one here? [Y/n] "
|
|
49
|
+
answer = $stdin.gets.to_s.strip.downcase
|
|
50
|
+
die "aborted — run cardinal inside a git repository" unless answer.empty? || answer.start_with?("y")
|
|
51
|
+
system("git", "init", "-q", "-b", "main", TARGET) || die("git init failed")
|
|
52
|
+
say "initialized empty git repository (branch: main)"
|
|
53
|
+
say "tip: add a GitHub remote later so agents can push branches and open PRs"
|
|
54
|
+
else
|
|
55
|
+
die "#{TARGET} is not a git repository — run `git init` first"
|
|
56
|
+
end
|
|
57
|
+
end
|
|
27
58
|
|
|
28
59
|
case cmd
|
|
29
60
|
when "logout"
|
|
@@ -34,7 +65,7 @@ when "login"
|
|
|
34
65
|
FileUtils.rm_f(TOKEN_FILE)
|
|
35
66
|
when "up" # continue
|
|
36
67
|
else
|
|
37
|
-
die "usage: cardinal [up|login|logout]"
|
|
68
|
+
die "usage: cardinal [up|login|logout] [-p PORT]"
|
|
38
69
|
end
|
|
39
70
|
|
|
40
71
|
# Hide .cardinal/ from the host repo without touching its .gitignore.
|
data/lib/cardinal/version.rb
CHANGED