Skip to content

Commit c50cff2

Browse files
committed
chore: establish BeatAPI CLI release baseline
0 parents  commit c50cff2

16 files changed

Lines changed: 2132 additions & 0 deletions

‎.env.example‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BEATAPI_API_KEY=sk_your_key
2+
BEATAPI_BASE_URL=https://api.beatapi.io
3+

‎.gitattributes‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto eol=lf
2+
*.png binary
3+
*.jpg binary
4+
*.jpeg binary
5+
*.webp binary

‎.gitignore‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
.env
3+
.env.*
4+
!.env.example
5+
coverage/
6+
dist/
7+
.worktrees/

‎CONTRIBUTING.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Contributing
2+
3+
1. Fork the repository and create a focused branch.
4+
2. Write a failing test before changing runtime behavior.
5+
3. Treat `contract/beatapi.openapi.yaml` as generated from the official public
6+
contract.
7+
4. Keep machine-readable output on stdout and progress on stderr.
8+
5. Run `npm run verify` before opening a pull request.
9+
6. Never use real API keys or private user media in tests.
10+

‎LICENSE‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2026 BeatAPI
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.
22+

‎README.md‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# BeatAPI CLI
2+
3+
A dependency-free Node.js command-line client for BeatAPI's public asynchronous
4+
video workflows.
5+
6+
This is an MVP scaffold. It is local-only and marked `private` until command
7+
behavior, package naming, authentication UX, and release ownership are reviewed.
8+
9+
## Requirements
10+
11+
- Node.js 20 or newer
12+
- `BEATAPI_API_KEY` for authenticated commands
13+
14+
```bash
15+
export BEATAPI_API_KEY="sk_your_key"
16+
npm link
17+
beatapi --help
18+
```
19+
20+
## Commands
21+
22+
```bash
23+
beatapi workflows
24+
beatapi usage
25+
beatapi file upload ./input.mp3
26+
beatapi music-video create --json ./music-video.json
27+
beatapi ecommerce-video create --json ./ecommerce-video.json
28+
beatapi task get task_123
29+
beatapi task wait task_123 --interval 7000 --attempts 120
30+
```
31+
32+
Task creation JSON follows the canonical public contract at
33+
`../beatapi-examples/openapi/beatapi.yaml`.
34+
35+
The CLI writes machine-readable result JSON to stdout. Polling progress and
36+
errors go to stderr so commands can be used in scripts.
37+
38+
## Development
39+
40+
```bash
41+
npm run check
42+
npm test
43+
```
44+

‎SECURITY.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Security policy
2+
3+
Never pass a BeatAPI key as a command-line argument or include it in issue
4+
reports, logs, shell transcripts, fixtures, or screenshots.
5+
6+
Use GitHub's private vulnerability reporting feature for security reports. If a
7+
credential may have been exposed, revoke it immediately in the
8+
[BeatAPI dashboard](https://beatapi.io/dashboard/apikeys).
9+
10+
The latest minor release is the supported release line.
11+

‎bin/beatapi.mjs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env node
2+
3+
import { run } from "../src/cli.mjs";
4+
5+
run(process.argv.slice(2)).catch((error) => {
6+
if (error?.name === "BeatAPIError") {
7+
const requestId = error.requestId
8+
? ` request_id=${error.requestId}`
9+
: "";
10+
console.error(
11+
`BeatAPI error: ${error.code || error.status || "request_failed"}: ${error.message}${requestId}`,
12+
);
13+
} else {
14+
console.error(error instanceof Error ? error.message : String(error));
15+
}
16+
process.exitCode = 1;
17+
});
18+

0 commit comments

Comments
 (0)