Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 78 to 79

Compare

+53 −13 in 3 places
Lines 5–11 at 79 (were 5–10 at 78)
55import { resolve } from "node:path";
66import { runAnnounce, runNews, runStart } from "./announce.ts";
77import { ApiError } from "./api.ts";
8+import { clientVersion } from "./client-version.ts";
89import { bool, type FlagSpec, type Parsed, parseArgs, str, UsageError } from "./args.ts";
910import { bodyFilesHelp, readBodyFiles, withBodyFiles } from "./body-files.ts";
1011import { boxPublic, boxText, login, logout, readBox } from "./box.ts";
Lines 791–847 at 79 (were 790–811 at 78)
790791 },
791792};
792793
793−function help(): string {
794+const HELP_INTRO = "abso: version control for agents. This is its command-line client.";
795+const HELP_NOTE =
796+ "Every command takes --json. Settings live in .abso/config.json (.avcs/config.json in a folder from before the rename). The token comes from ABSO_TOKEN, or else ~/.abso/token (or ~/.avcs/token from before).";
798+/** Every command as help shows it, in order: the table's, then the three it doesn't hold. */
799+function helpEntries(): { name: string; usage: string; about: string; flags: FlagSpec }[] {
794800 return [
795− "abso: version control for agents. This is its command-line client.",
796− "",
797− ...Object.values(COMMANDS).flatMap((c) => [` ${c.usage}`, ` ${c.about}`]),
798− " abso hook",
799− " The Claude Code PostToolUse hook. Reads the hook JSON on stdin; never fails.",
800− " abso mcp",
801− " An MCP server on stdin and stdout: the reading commands and the everyday writing ones as tools, answering with the same text as here. Add it with claude mcp add abso -- abso mcp (on Windows, claude mcp add abso -- cmd /c abso mcp).",
802− " abso --version",
803− " This client's version and commit, and the abso mods installed on this machine.",
804− "",
805− "Every command takes --json. Settings live in .abso/config.json (.avcs/config.json in a folder from before the rename). The token comes from ABSO_TOKEN, or else ~/.abso/token (or ~/.avcs/token from before).",
806− ].join("\n");
801+ ...Object.entries(COMMANDS).map(([name, c]) => ({ name, usage: c.usage, about: c.about, flags: c.flags })),
802+ {
803+ name: "hook",
804+ usage: "abso hook",
805+ about: "The Claude Code PostToolUse hook. Reads the hook JSON on stdin; never fails.",
806+ flags: {},
807+ },
808+ {
809+ name: "mcp",
810+ usage: "abso mcp",
811+ about:
812+ "An MCP server on stdin and stdout: the reading commands and the everyday writing ones as tools, answering with the same text as here. Add it with claude mcp add abso -- abso mcp (on Windows, claude mcp add abso -- cmd /c abso mcp).",
813+ flags: {},
814+ },
815+ {
816+ name: "--version",
817+ usage: "abso --version",
818+ about: "This client's version and commit, and the abso mods installed on this machine.",
819+ flags: {},
820+ },
821+ ];
807822}
808823
824+function help(): string {
825+ const entries = helpEntries().flatMap((c) => [` ${c.usage}`, ` ${c.about}`]);
826+ return [HELP_INTRO, "", ...entries, "", HELP_NOTE].join("\n");
827+}
829+/**
830+ * help --json: the same entries as data, for a command reference built from the client itself. A flag is
831+ * "string" (takes a value), "boolean" (stands alone) or "optional" (a value that may be left off); every
832+ * command also takes --json and --help.
833+ */
834+function helpJson(): Record<string, unknown> {
835+ return {
836+ ok: true,
837+ command: "help",
838+ version: clientVersion(),
839+ intro: HELP_INTRO,
840+ note: HELP_NOTE,
841+ commands: helpEntries(),
842+ };
843+}
809845export interface MainResult {
810846 readonly stdout: string;
811847 readonly stderr: string;
Lines 875–884 at 79 (were 839–844 at 78)
839875 const command = argv[0];
840876 const json = argv.includes("--json") && command !== "run" && command !== "logs";
841877 if (command === undefined || command === "help" || command === "--help" || command === "-h") {
878+ if (json) {
879+ const data = helpJson();
880+ return { stdout: `${JSON.stringify(data, null, 2)}\n`, stderr: "", exit: EXIT.ok, data };
881+ }
842882 return { stdout: `${help()}\n`, stderr: "", exit: EXIT.ok };
843883 }
844884 try {
MCP
compare on this site's /mcp
CLI
abso diff 78 79 client/src/main.ts --json
JSON
/christopher/abso-core/compare/78..79?file=client%2Fsrc%2Fmain.ts&format=json