@liaisonio/cli 0.1.1 → 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 (2) hide show
  1. package/README.md +79 -18
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -3,11 +3,14 @@
3
3
  Official command-line interface for [liaison.cloud](https://liaison.cloud), designed
4
4
  to be **scripted and agent-friendly**.
5
5
 
6
- - JSON output by default ready for piping into `jq` or parsing by LLM agents
6
+ - **One-shot bootstrap** `liaison quickstart` creates a connector + application + public entry in a single call
7
+ - **5 Agent Skills** — drop-in Skill files for AI agents (Claude/Cursor/etc.), installable via `npx skills add liaisonio/cli`
8
+ - JSON output by default — pipe into `jq` or parse from any LLM agent
7
9
  - `--output table` for humans, `--output yaml` when you prefer it
8
10
  - Credentials from env var (`LIAISON_TOKEN`), config file, or explicit `--token` flag
11
+ - Browser-based PAT login (or `--no-browser` for headless / SSH)
9
12
  - Every command has `-h` / `--help` with examples
10
- - Non-interactive by default: destructive operations require `--yes`
13
+ - Non-interactive by default destructive operations require `--yes`
11
14
 
12
15
  ## Install
13
16
 
@@ -62,30 +65,88 @@ liaison version
62
65
 
63
66
  ## Authenticate
64
67
 
65
- The CLI accepts a JWT bearer token issued by liaison.cloud. For now the slider-captcha
66
- login flow used by the web UI is not supported headlessly — you need to obtain the
67
- token out of band:
68
+ The CLI uses long-lived **Personal Access Tokens** (PATs) `liaison_pat_xxx...`
69
+ issued by the Liaison dashboard. Three ways to provide one:
68
70
 
69
- 1. Log in to [liaison.cloud](https://liaison.cloud) in your browser.
70
- 2. Open DevTools Application Local Storage → copy the `authorization` value.
71
- 3. Persist it:
71
+ ```bash
72
+ # 1) Browser flow (recommended for humans)
73
+ liaison login
74
+ # Opens https://liaison.cloud/dashboard/cli-auth in your default browser,
75
+ # you click "Authorize", a fresh PAT is minted and persisted to ~/.liaison/config.yaml.
76
+
77
+ # 2) SSH / headless / no browser
78
+ liaison login --no-browser
79
+ # Prints the URL — open it on any device that has a browser, click Authorize,
80
+ # the CLI receives the token via a localhost callback.
81
+
82
+ # 3) Already have a token (CI, agent secrets store)
83
+ LIAISON_TOKEN=liaison_pat_a1b2c3... liaison whoami
84
+ # Or: liaison login --token liaison_pat_a1b2c3...
85
+ ```
86
+
87
+ Precedence (highest wins): `--token` flag → `LIAISON_TOKEN` env → `~/.liaison/config.yaml` → no token.
88
+
89
+ Tokens can be revoked any time at **liaison.cloud → Settings → API Tokens**, or by running:
90
+
91
+ ```bash
92
+ liaison logout
93
+ ```
94
+
95
+ ## Quick Start
96
+
97
+ The fastest way to expose a local service:
98
+
99
+ ```bash
100
+ # 1) authenticate once
101
+ liaison login
102
+
103
+ # 2) bootstrap a connector + register your service + expose it publicly
104
+ liaison quickstart --name mybox \
105
+ --app-name web --app-ip 127.0.0.1 --app-port 8080 --app-protocol http \
106
+ --expose --wait-online 2m
107
+
108
+ # The output JSON includes:
109
+ # - install_command → run this on your target host (curl|bash one-liner)
110
+ # - entry.port → public TCP port (or entry.domain for http)
111
+ # - online_achieved → whether the connector successfully connected
112
+ ```
113
+
114
+ `liaison quickstart` is a single command that:
115
+
116
+ 1. Creates the connector (and returns the install command for the host)
117
+ 2. Optionally runs the install script locally (`--install`, requires sudo)
118
+ 3. Optionally polls for the connector to come online (`--wait-online <duration>`)
119
+ 4. Optionally registers a backend application (`--app-*` flags)
120
+ 5. Optionally exposes it via a public entry (`--expose`)
72
121
 
73
- ```bash
74
- liaison login --token eyJhbGciOi...
75
- ```
122
+ See `liaison quickstart --help` for the full flag list.
76
123
 
77
- This writes `~/.liaison/config.yaml` (mode 0600) and verifies the token against
78
- `/api/v1/iam/profile_json`.
124
+ ## Agent Skills
79
125
 
80
- Alternatively, skip the config file entirely and pass the token per-invocation:
126
+ This CLI ships **5 [Skill files](./skills/)** so AI agents (Claude, Cursor, Continue, etc.)
127
+ know how to use it without a learning curve. Each skill is a self-contained Markdown
128
+ spec with frontmatter — installable with one command:
81
129
 
82
130
  ```bash
83
- LIAISON_TOKEN=eyJhbGciOi... liaison edge list
84
- # or
85
- liaison --token eyJhbGciOi... edge list
131
+ # Install all liaison skills into the agent's skills directory
132
+ npx skills add liaisonio/cli -y -g
86
133
  ```
87
134
 
88
- Precedence (highest wins): `--token` flag → `LIAISON_TOKEN` env → config file → built-in default.
135
+ | Skill | Purpose |
136
+ |-------|---------|
137
+ | `liaison-shared` | Auth, install, token precedence, error handling, output format (auto-loaded by other skills) |
138
+ | `liaison-quickstart` | One-shot bootstrap: connector + application + entry in a single call |
139
+ | `liaison-connector` | Connector lifecycle: create / list / inspect / enable+disable / delete |
140
+ | `liaison-application` | Backend service metadata: register / list / update / delete |
141
+ | `liaison-entry` | Public exposure: HTTP domains, TCP ports, enable+disable, delete |
142
+
143
+ After installing the skills, point your agent at `liaison.cloud` and ask it
144
+ things like:
145
+
146
+ - "Set up a public SSH endpoint for my home server"
147
+ - "List all my connectors and tell me which ones are offline"
148
+ - "Disable connector 100017 — I'm doing maintenance"
149
+ - "Expose the local Postgres on 5432 via Liaison"
89
150
 
90
151
  ## Usage
91
152
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liaisonio/cli",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Liaison Cloud CLI — manage connectors, entries, and applications from the command line",
5
5
  "keywords": [
6
6
  "liaison",