@oppira/cli 0.1.0 → 0.1.1
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 +60 -110
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,147 +1,97 @@
|
|
|
1
|
-
# Oppira CLI
|
|
1
|
+
# Oppira CLI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Drive **Oppira** from your terminal — competitor intelligence, your marketing
|
|
4
|
+
playbook, battlecards, the content studio, and the Oppira AI agent — with
|
|
5
|
+
scriptable, JSON-friendly output.
|
|
5
6
|
|
|
6
|
-
##
|
|
7
|
+
## Requirements
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|------|-----|--------|------|
|
|
10
|
-
| **Remote** (default) | HTTP client against the deployed API | customers, agents, CI | JWT login, or durable `ca_` API key |
|
|
11
|
-
| **Local / ops** | Imports the backend engines + Mongo directly | the team | backend `.env` (MONGO_URI + secrets) |
|
|
12
|
-
|
|
13
|
-
Local mode reaches the **cron-only generators** (insights / alerts / battlecard) and
|
|
14
|
-
the **intelligent scraper** without needing new HTTP endpoints — it mirrors the
|
|
15
|
-
existing one-off scripts in `../scripts` (dotenv + `mongoose.connect` + engine call).
|
|
16
|
-
It only works from a repo checkout with the backend secrets present.
|
|
9
|
+
- **Node.js 20+**
|
|
17
10
|
|
|
18
11
|
## Install
|
|
19
12
|
|
|
20
|
-
**For end users (published package):**
|
|
21
|
-
|
|
22
13
|
```bash
|
|
23
14
|
npm install -g @oppira/cli
|
|
24
15
|
oppira --help
|
|
25
16
|
```
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
cd cli && npm link # then `oppira` is on your PATH
|
|
31
|
-
# or run directly:
|
|
32
|
-
node cli/bin/oppira.js --help
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Only the repo checkout can run the local/ops commands (they need the backend
|
|
36
|
-
`.env` + `node_modules`). The published package runs the **remote** commands.
|
|
37
|
-
|
|
38
|
-
## First run
|
|
18
|
+
## Quick start
|
|
39
19
|
|
|
40
20
|
```bash
|
|
41
|
-
oppira config set-url https://api.oppira.com
|
|
42
|
-
oppira auth login --email you@
|
|
43
|
-
oppira comp list
|
|
21
|
+
oppira config set-url https://api.oppira.com # your Oppira API endpoint
|
|
22
|
+
oppira auth login --email you@company.com # log in
|
|
23
|
+
oppira comp list # see your tracked competitors
|
|
24
|
+
oppira ask "how did my top competitor shift this month?"
|
|
44
25
|
```
|
|
45
26
|
|
|
46
|
-
|
|
27
|
+
Config is stored in `~/.oppira/` (credentials are kept in a separate, locked-down
|
|
28
|
+
file). You can run against several accounts/environments with **profiles**
|
|
29
|
+
(`oppira config use <name>` or `--profile <name>`).
|
|
47
30
|
|
|
48
|
-
|
|
31
|
+
## Authentication
|
|
49
32
|
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
oppira auth login --email you@co.com
|
|
53
|
-
```
|
|
54
|
-
Stores a JWT + refresh token; auto-refreshes. Best for interactive use.
|
|
33
|
+
Pick either method per profile:
|
|
55
34
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
> for REST commands.
|
|
35
|
+
- **Login (interactive):**
|
|
36
|
+
```bash
|
|
37
|
+
oppira auth login --email you@company.com
|
|
38
|
+
```
|
|
39
|
+
- **API key (best for scripts / CI):** create a key in the Oppira web app, then:
|
|
40
|
+
```bash
|
|
41
|
+
oppira auth key set ca_xxxxxxxx
|
|
42
|
+
```
|
|
65
43
|
|
|
66
|
-
|
|
67
|
-
`~/.oppira/credentials.json` (chmod 600). Multiple profiles are supported
|
|
68
|
-
(`oppira config use <name>`, `--profile <name>`, or `OPPIRA_PROFILE`).
|
|
44
|
+
`oppira auth whoami` shows the current account; `oppira auth logout` clears it.
|
|
69
45
|
|
|
70
46
|
## Commands
|
|
71
47
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
comp
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```
|
|
48
|
+
| Group | What you can do |
|
|
49
|
+
|-------|-----------------|
|
|
50
|
+
| `oppira ask "…"` | Ask the Oppira AI agent (streams the answer). Reads args or stdin. |
|
|
51
|
+
| `oppira comp` | `list`, `show`, `add`, `track`, `toggle-tracking`, `insights`, `alerts`, `rm` |
|
|
52
|
+
| `oppira insights` | `list`, `summary`, `generate` |
|
|
53
|
+
| `oppira alerts` | `list`, `run` |
|
|
54
|
+
| `oppira battlecard` | `show`, `history`, `regen` |
|
|
55
|
+
| `oppira playbook` | `show`, `bootstrap`, `refresh-section`, `refresh-cluster` |
|
|
56
|
+
| `oppira discover` | `profiles`, `suggestions`, `dismiss` |
|
|
57
|
+
| `oppira studio` | posts, calendars, comments, templates, image generation, publishing *(Pro)* |
|
|
58
|
+
| `oppira artifact` | `get`, `export` (reports / decks / diagrams) |
|
|
59
|
+
| `oppira config` / `oppira auth` | profiles, API URL, login, API keys |
|
|
60
|
+
|
|
61
|
+
Run `oppira <group> --help` for a group's commands, or `oppira <group> <command> --help` for details.
|
|
87
62
|
|
|
88
|
-
|
|
89
|
-
|
|
63
|
+
Feature access follows your Oppira plan (e.g. the AI agent, playbook and
|
|
64
|
+
battlecards are available from **Basic** up; **Studio** is **Pro**). If a command
|
|
65
|
+
isn't available on your plan you'll get a clear upgrade message.
|
|
90
66
|
|
|
91
|
-
|
|
67
|
+
## Examples
|
|
92
68
|
|
|
93
69
|
```bash
|
|
94
|
-
|
|
70
|
+
# Ask the agent, pipe the answer into your own tooling
|
|
95
71
|
oppira ask "summarize my playbook" --json | jq -r .text
|
|
96
|
-
oppira scrape run Acme --platforms fb,ig # ops, local mode
|
|
97
|
-
oppira insights generate --email client@co.com # force cron-only generator
|
|
98
|
-
oppira battlecard regen Globex
|
|
99
|
-
oppira admin errors --limit 20
|
|
100
|
-
oppira admin ai-usage --by-plan
|
|
101
|
-
```
|
|
102
72
|
|
|
103
|
-
|
|
73
|
+
# Competitors
|
|
74
|
+
oppira comp show Acme
|
|
75
|
+
oppira comp add "Globex" --website globex.com --instagram https://instagram.com/globex
|
|
104
76
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
set on the server:
|
|
77
|
+
# Refresh strategic docs on demand
|
|
78
|
+
oppira insights generate
|
|
79
|
+
oppira battlecard regen Acme
|
|
109
80
|
|
|
110
|
-
|
|
111
|
-
|
|
81
|
+
# Export a generated report
|
|
82
|
+
oppira artifact export <id> --format pdf
|
|
112
83
|
```
|
|
113
84
|
|
|
114
|
-
|
|
85
|
+
## Scripting & automation
|
|
115
86
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
87
|
+
- Add `--json` to any command for machine-readable output.
|
|
88
|
+
- Commands exit non-zero on failure, so they behave well in CI.
|
|
89
|
+
- `oppira ask` reads a question from arguments **or** piped stdin.
|
|
119
90
|
|
|
120
91
|
```bash
|
|
121
|
-
|
|
122
|
-
npm version patch # or minor/major — bump the version
|
|
123
|
-
npm publish # publishes @oppira/cli to npm
|
|
92
|
+
echo "what should I post about this week?" | oppira ask --json
|
|
124
93
|
```
|
|
125
94
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
is unchanged) and drop `publishConfig`.
|
|
130
|
-
- `npm login` first; the publish is public.
|
|
131
|
-
- Only `bin/`, `src/`, `README.md` ship (the `files` field) — no repo internals.
|
|
132
|
-
- End users then: `npm install -g @oppira/cli`.
|
|
133
|
-
|
|
134
|
-
## Status (phased build)
|
|
135
|
-
|
|
136
|
-
- **Working now:** auth/config, competitors (+ analytics: timeline/compare/top-posts/tone in
|
|
137
|
-
local mode), discover, playbook, insights/alerts/battlecard reads, `ask` (SSE), artifact
|
|
138
|
-
get/export, admin (reads + user mgmt + `script` runner folding `../scripts`), studio
|
|
139
|
-
(posts/calendars/comments/templates/formats/settings/channels/assets/policy + actions),
|
|
140
|
-
local/ops force-generators + intelligent scrape.
|
|
141
|
-
- **Remote force-generate:** `insights generate`, `alerts run`, `battlecard regen` now hit
|
|
142
|
-
owner-scoped REST endpoints by default (added to the backend); pass `--local` to run the
|
|
143
|
-
engine directly instead.
|
|
144
|
-
- **Follow-up (still open):** MCP-backed analytics over HTTP (so timeline/compare/top-N work
|
|
145
|
-
remotely, not just local), deeper Studio (image-layer editing, ads), and per-endpoint
|
|
146
|
-
rate-limiting on the force-generate routes.
|
|
147
|
-
```
|
|
95
|
+
## Support
|
|
96
|
+
|
|
97
|
+
Questions or issues? Reach the Oppira team at [oppira.com](https://oppira.com).
|