@foleo/cli 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Foleo contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # Foleo CLI
2
+
3
+ Publish and manage Markdown documents and trusted active-HTML artifacts through Foleo Publish.
4
+
5
+ ## Requirements
6
+
7
+ - macOS
8
+ - Node.js 22 or later
9
+ - An invited Foleo Publish account
10
+
11
+ ## Install and sign in
12
+
13
+ ```sh
14
+ npm install --global @foleo/cli@0.1.0
15
+ foleo login
16
+ foleo whoami
17
+ foleo doctor
18
+ ```
19
+
20
+ `foleo skill get` prints the version-matched bundled skill, and `foleo skill path`
21
+ prints its installed location. Agents can read the live contract at
22
+ [https://foleo.app/agents.md](https://foleo.app/agents.md), also available as
23
+ `https://foleo.app/CLAUDE.md`. Foleo has no MCP service during this beta.
24
+
25
+ Production is the default. Use `--staging` on any command for a staging rehearsal, or run `foleo environment --staging` to verify the selected API. `FOLEO_API_BASE` remains an explicit custom override.
26
+
27
+ ## Markdown
28
+
29
+ ```sh
30
+ foleo publish ./notes.md --json
31
+ foleo update <id> ./notes.md --version <version> --json
32
+ foleo status <id> --json
33
+ foleo unpublish <id> --json
34
+ ```
35
+
36
+ ## Trusted HTML alpha
37
+
38
+ HTML is executable content. A human must inspect the local source and explicitly approve the hosting risk before an agent uses the acknowledgement flag. For the pre-PSL friends alpha, publish one self-contained `index.html` with no remote dependencies and no sensitive information.
39
+
40
+ ```sh
41
+ foleo html-publish ./site --accept-hosting-risk --json
42
+ foleo html-status <id> --json
43
+ foleo html-visibility <id> --set private --revision <stateRevision> --json
44
+ foleo html-password <id> --password '<12–256 character password>' --revision <stateRevision> --json
45
+ foleo html-visibility <id> --set unlisted --revision <stateRevision> --json
46
+ foleo html-unpublish <id> --revision <stateRevision> --json
47
+ ```
48
+
49
+ Carry the latest returned `stateRevision` into every HTML mutation. Public HTML is not available during this alpha.
50
+
51
+ The CLI stores its credential in macOS Keychain. Never write credentials into source files, prompts, artifacts, or repositories. See [https://foleo.app/agents.md](https://foleo.app/agents.md) for the concise agent contract.
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+ export interface CliDeps {
3
+ fetch: typeof fetch;
4
+ readFile(path: string, encoding: BufferEncoding): Promise<string>;
5
+ readFileBytes?(path: string): Promise<Uint8Array>;
6
+ readdir?(path: string): Promise<string[]>;
7
+ lstat?(path: string): Promise<{
8
+ isDirectory(): boolean;
9
+ isFile(): boolean;
10
+ isSymbolicLink(): boolean;
11
+ size: number;
12
+ dev?: number;
13
+ ino?: number | bigint;
14
+ }>;
15
+ env: Record<string, string | undefined>;
16
+ stdout(message: string): void;
17
+ stderr(message: string): void;
18
+ createBrowserCallback?(nonce: string): Promise<BrowserCallback>;
19
+ openUrl?(url: string): Promise<void>;
20
+ loadCredential?(apiBase: string): Promise<string | null>;
21
+ loadAppSession?(apiBase: string): Promise<string | null>;
22
+ saveCredential?(apiBase: string, token: string): Promise<void>;
23
+ deleteCredential?(apiBase: string): Promise<void>;
24
+ verifyCredentialStore?(apiBase: string): Promise<void>;
25
+ platform?: NodeJS.Platform;
26
+ nodeVersion?: string;
27
+ now?(): number;
28
+ sleep?(milliseconds: number): Promise<void>;
29
+ }
30
+ export interface BrowserCallback {
31
+ callbackUrl: string;
32
+ waitForCode(): Promise<string>;
33
+ close(): Promise<void>;
34
+ }
35
+ export declare function runCli(argv: string[], deps?: CliDeps): Promise<number>;
36
+ type HtmlFile = {
37
+ path: string;
38
+ sha256: string;
39
+ byteSize: number;
40
+ mediaType: string;
41
+ bytes: Uint8Array;
42
+ };
43
+ export declare function scanBundle(root: string, deps: CliDeps): Promise<HtmlFile[]>;
44
+ type LiveDocAssetFile = {
45
+ path: string;
46
+ sha256: string;
47
+ byteSize: number;
48
+ mediaType: string;
49
+ bytes: Uint8Array;
50
+ };
51
+ /**
52
+ * Scan Markdown for relative raster image references and build a live-doc
53
+ * assets manifest (spec 065). Absolute http(s) / data: / rooted paths skipped.
54
+ */
55
+ export declare function scanMarkdownAssets(markdownPath: string, markdown: string, deps: CliDeps): Promise<LiveDocAssetFile[]>;
56
+ export declare function createLoopbackCallback(nonce: string, timeoutMs?: number): Promise<BrowserCallback>;
57
+ export {};
58
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAqCA,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,aAAa,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UA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