codeconscious 0.1.2 → 0.2.0

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 +17 -3
  2. package/dist/cli.cjs +1460 -2779
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -11,13 +11,26 @@ npx codeconscious init
11
11
  - `codeconscious init` install hooks in the current git repo (chains with husky, lefthook, `core.hooksPath`; nothing is overwritten) and log in
12
12
  - `codeconscious uninstall` remove the hooks and restore the previous state
13
13
  - `codeconscious quiz` answer the pending question for your current commit (and a few more, one at a time)
14
- - `codeconscious status` show login, hook state and installed version
14
+ - `codeconscious logout` revoke this machine's login on the server (2 s, best effort) and delete the local token; hooks then stay silent until you run `init` again
15
+ - If a command says "Your CLI login expired or was revoked", run `npx codeconscious@latest init` to log in again
16
+ - `codeconscious status` show login, hook state, installed version, and your plan and usage
17
+ - `codeconscious duck` a small easter egg, works offline
15
18
  - `npx codeconscious --version` print the version
16
19
  - `codeconscious --help` list all commands
17
20
 
18
21
  ## On push, and when an AI agent commits for you
19
22
 
20
- On `git push` you see a one-line teaser: "Press space or enter to answer (15s), s to skip". Press a key within 15 s and the question starts with no countdown (the push waits for you; `s`, Esc, Ctrl-D or Ctrl-C always lets it continue, and Ctrl-C at the prompt skips the question). If you press nothing, or there is no terminal (AI agents, CI), nothing is recorded and unanswered questions wait for `npx codeconscious quiz`.
23
+ On `git push` you see a one-line teaser that shows its own time window ("Press space or enter to answer (Ns), s to skip"). Press a key within that window and the question starts with no countdown (the push waits for you; `s` skips, Esc and Ctrl-D skip too, and Ctrl-C cancels without recording anything; none of them blocks or aborts the push). If you press nothing, or there is no terminal (AI agents, CI), nothing is recorded and unanswered questions wait for `npx codeconscious quiz`.
24
+
25
+ A question you were offered and did not answer is not offered again at the next push for 24 hours (the CLI remembers the ids locally in `~/.codeconscious/offered.json`, owner-only, at most 100 entries). It stays available through `codeconscious quiz`.
26
+
27
+ A question screen shows, in this order: the file and lines (with difficulty and type), the code with line numbers, the question, four choices numbered 1-4 and a one-line key hint. Move with the arrow keys and press enter, or press 1-4; `s` skips. After answering you see whether it was right, the correct choice, the explanation and, for "spot the bug", the original and the changed line.
28
+
29
+ Submitting an answer you chose to give may wait up to 10 s in total (retried once inside that); Ctrl-C or `s` while it says "Recording your answer..." stops waiting and never aborts the push. If it still fails, the message names the cause (server too slow, no network, server error, login expired). After a timeout or when you stop waiting, the server may already have the answer: the message then says it may not have been recorded and, if so, stays pending for `codeconscious quiz`. Skips and unattended runs never wait more than 2 s and ignore these keys.
30
+
31
+ When `quiz` finds nothing it says why (still generating, daily limit used up, no question came out of the commit, all caught up) and which repo and commit it looked for.
32
+
33
+ Colour is restrained and follows `NO_COLOR` / `FORCE_COLOR`; terminals that are not UTF-8 get an ASCII layout.
21
34
 
22
35
  If an AI agent commits for you, run `npx codeconscious quiz` afterwards.
23
36
 
@@ -48,11 +61,12 @@ There is no auto-update, by design. Hooks never reach the network except the 2 s
48
61
  - Only diffs leave your machine, never the full repo.
49
62
  - `.gitignore` and `.codeconsciousignore` are respected. Lockfiles, `.env*`, keys and binaries are never uploaded.
50
63
  - Obvious secrets are redacted before upload.
51
- - Uploads run in a detached background process. Every network call times out after 2 s and fails open: the CLI never blocks or breaks a push.
64
+ - Uploads run in a detached background process (it may wait up to 10 s, it never blocks you). Every network call inside a hook times out after 2 s and fails open: the CLI never blocks or breaks a push. The only longer wait is submitting an answer you chose to give (up to 10 s, one retry).
52
65
 
53
66
  ## Configuration
54
67
 
55
68
  - `CODECONSCIOUS_API_URL` API base (default `https://code-conscious.com`; http only for localhost)
56
69
  - `CODECONSCIOUS_SKIP=1` disable the quiz
70
+ - `NO_COLOR` / `FORCE_COLOR` turn colour off / on
57
71
 
58
72
  Node 18+. macOS, Linux, Windows (Git Bash). https://code-conscious.com