@tinycloud/cli 0.1.0 → 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.
package/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # @tinycloud/cli
2
+
3
+ Self-sovereign storage from the terminal. `tc` is the command-line interface for [TinyCloud](https://tinycloud.xyz) — manage data, delegations, spaces, and nodes without leaving your shell.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @tinycloud/cli
9
+ ```
10
+
11
+ Requires Node.js >= 18.
12
+
13
+ ## Quick Start
14
+
15
+ ```bash
16
+ # Set up a profile and generate keys
17
+ tc init
18
+
19
+ # Authenticate via browser
20
+ tc auth login
21
+
22
+ # Store and retrieve data
23
+ tc kv put greeting "Hello, world"
24
+ tc kv get greeting
25
+ tc kv list
26
+
27
+ # Manage spaces
28
+ tc space list
29
+ tc space create
30
+
31
+ # Grant access to another user
32
+ tc delegation create --to did:pkh:eip155:1:0x...
33
+ ```
34
+
35
+ ## Commands
36
+
37
+ | Command | Description |
38
+ |---------|-------------|
39
+ | `tc init` | Set up a profile and generate keys |
40
+ | `tc auth login` | Authenticate via browser |
41
+ | `tc auth status` | Show authentication status |
42
+ | `tc auth whoami` | Show current identity |
43
+ | `tc kv get <key>` | Retrieve a value |
44
+ | `tc kv put <key> <value>` | Store a value |
45
+ | `tc kv list` | List all keys |
46
+ | `tc space list` | List your spaces |
47
+ | `tc space create` | Create a new space |
48
+ | `tc delegation create` | Grant access to another user |
49
+ | `tc delegation list` | List delegations |
50
+ | `tc share` | Share data with another user |
51
+ | `tc node` | Manage TinyCloud nodes |
52
+ | `tc profile list` | List profiles |
53
+ | `tc profile show` | Show profile details |
54
+ | `tc profile create` | Create a new profile |
55
+ | `tc vault` | Manage encrypted vaults |
56
+ | `tc secrets` | Manage secrets |
57
+ | `tc vars` | Manage environment variables |
58
+ | `tc doctor` | Run diagnostic checks |
59
+ | `tc completion` | Generate shell completions |
60
+
61
+ ## Global Options
62
+
63
+ ```
64
+ -p, --profile <name> Profile to use
65
+ -H, --host <url> TinyCloud node URL
66
+ -v, --verbose Enable verbose output
67
+ -q, --quiet Suppress non-essential output
68
+ --json Force JSON output
69
+ --no-cache Disable caching
70
+ ```
71
+
72
+ ## Output Modes
73
+
74
+ `tc` auto-detects your terminal:
75
+
76
+ - **Interactive (TTY)** — human-friendly output with colors, tables, and status icons
77
+ - **Piped / redirected** — structured JSON for scripting
78
+ - **`--json` flag** — force JSON output in any context
79
+
80
+ ```bash
81
+ # Human-friendly table
82
+ tc kv list
83
+
84
+ # JSON for scripting
85
+ tc kv list --json
86
+ tc kv list | jq '.[]'
87
+ ```
88
+
89
+ ## Diagnostics
90
+
91
+ ```bash
92
+ tc doctor
93
+ ```
94
+
95
+ Checks Node.js version, profile configuration, keys, session status, node connectivity (with latency), and space availability. Outputs actionable guidance for any failing checks.
96
+
97
+ ## Profiles
98
+
99
+ `tc` supports multiple profiles for different environments:
100
+
101
+ ```bash
102
+ tc profile create staging --host https://staging.tinycloud.xyz
103
+ tc profile list
104
+ tc kv list --profile staging
105
+ ```
106
+
107
+ ## Environment
108
+
109
+ | Variable | Description |
110
+ |----------|-------------|
111
+ | `TC_HIDE_BANNER` | Set to `1` to suppress the startup banner |
112
+
113
+ ## Development
114
+
115
+ ```bash
116
+ # Install dependencies
117
+ bun install
118
+
119
+ # Build
120
+ bun run build
121
+
122
+ # Watch mode
123
+ bun run dev
124
+ ```
125
+
126
+ ## License
127
+
128
+ EGPL