@ktmcp-cli/billingo 1.0.0 → 1.0.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 CHANGED
@@ -1,378 +1,199 @@
1
- # Billingo CLI
1
+ # Billingo API CLI
2
2
 
3
- <p align="center">
4
- <img src="banner.png" alt="KTMCP Banner" width="100%">
5
- </p>
3
+ > "Six months ago, everyone was talking about MCPs. And I was like, screw MCPs. Every MCP would be better as a CLI."
4
+ >
5
+ > — [Peter Steinberger](https://twitter.com/steipete), Founder of OpenClaw
6
+ > [Watch on YouTube (~2:39:00)](https://www.youtube.com/@lexfridman) | [Lex Fridman Podcast #491](https://lexfridman.com/peter-steinberger/)
6
7
 
8
+ A production-ready command-line interface for the Billingo API v3. Manage invoices, partners, products, and bank accounts for Hungarian businesses directly from your terminal.
7
9
 
8
- Production-ready command-line interface for the [Billingo API v3](https://www.billingo.hu/) - Hungarian invoicing and billing automation.
10
+ > **Disclaimer**: This is an unofficial CLI tool and is not affiliated with, endorsed by, or supported by Billingo.
9
11
 
10
12
  ## Features
11
13
 
12
- - Complete coverage of Billingo API v3 endpoints
13
- - Simple, intuitive command structure
14
- - JSON and pretty-print output formats
15
- - File-based and inline data input
16
- - Comprehensive error handling with rate limit management
17
- - Persistent configuration storage
18
- - Progress indicators for long-running operations
14
+ - **Invoices** Create, list, send, and manage invoices
15
+ - **Partners** Manage customers and suppliers
16
+ - **Products** Maintain product catalog
17
+ - **Bank Accounts** Manage payment accounts
18
+ - **Organization** View organization details and supported currencies
19
+ - **JSON output** — All commands support `--json` for scripting
19
20
 
20
21
  ## Why CLI > MCP
21
22
 
22
- ### The MCP Problem
23
+ MCP servers are complex, stateful, and require a running server process. A CLI is:
23
24
 
24
- Model Context Protocol (MCP) servers introduce unnecessary complexity and failure points for API access:
25
-
26
- 1. **Extra Infrastructure Layer**: MCP requires running a separate server process that sits between your AI agent and the API
27
- 2. **Cognitive Overhead**: Agents must learn MCP-specific tool schemas on top of the actual API semantics
28
- 3. **Debugging Nightmare**: When things fail, you're debugging three layers (AI MCP API) instead of two (AI → API)
29
- 4. **Limited Flexibility**: MCP servers often implement a subset of API features, forcing you to extend or work around limitations
30
- 5. **Maintenance Burden**: Every API change requires updating both the MCP server and documentation
31
-
32
- ### The CLI Advantage
33
-
34
- A well-designed CLI is the superior abstraction for AI agents:
35
-
36
- 1. **Zero Runtime Dependencies**: No server process to start, monitor, or crash
37
- 2. **Direct API Access**: One hop from agent to API with transparent HTTP calls
38
- 3. **Human + AI Usable**: Same tool works perfectly for both developers and agents
39
- 4. **Self-Documenting**: Built-in `--help` text provides complete usage information
40
- 5. **Composable**: Standard I/O allows piping, scripting, and integration with other tools
41
- 6. **Better Errors**: Direct error messages from the API without translation layers
42
- 7. **Instant Debugging**: `--format json` gives you the exact API response for inspection
43
-
44
- **Example Complexity Comparison:**
45
-
46
- MCP approach:
47
- ```
48
- AI Agent → MCP Tool Schema → MCP Server → HTTP Request → API → Response Chain (reverse)
49
- ```
50
-
51
- CLI approach:
52
- ```
53
- AI Agent → Shell Command → HTTP Request → API → Direct Response
54
- ```
55
-
56
- The CLI is simpler, faster, more reliable, and easier to debug.
25
+ - **Simpler** Just a binary you call directly
26
+ - **Composable** — Pipe output to `jq`, `grep`, `awk`, and other tools
27
+ - **Scriptable** Use in shell scripts, CI/CD pipelines, cron jobs
28
+ - **Debuggable** See exactly what's happening with `--json` flag
29
+ - **AI-friendly** AI agents can call CLIs just as easily as MCPs, with less overhead
57
30
 
58
31
  ## Installation
59
32
 
60
33
  ```bash
61
- npm install -g @ktmcp-cli/billingo
62
- ```
63
-
64
- Or install locally:
65
-
66
- ```bash
67
- cd billingo
68
- npm install
69
- npm link
70
- ```
71
-
72
- ## Configuration
73
-
74
- ### Set API Key
75
-
76
- Get your API key from https://app.billingo.hu/api-key
77
-
78
- ```bash
79
- billingo config set apiKey YOUR_API_KEY_HERE
80
- ```
81
-
82
- ### Environment Variables
83
-
84
- Alternatively, use environment variables:
85
-
86
- ```bash
87
- export BILLINGO_API_KEY=your_api_key_here
88
- export BILLINGO_BASE_URL=https://api.billingo.hu/v3 # Optional
34
+ npm install -g @ktmcp-cli/billingohu
89
35
  ```
90
36
 
91
- ### View Configuration
37
+ ## Authentication Setup
92
38
 
93
- ```bash
94
- # Show all config
95
- billingo config list
96
-
97
- # Get specific value
98
- billingo config get apiKey
99
-
100
- # Clear all config
101
- billingo config clear
102
- ```
103
-
104
- ## Usage
105
-
106
- ### General Syntax
39
+ Configure your Billingo API key:
107
40
 
108
41
  ```bash
109
- billingo <resource> <action> [options]
42
+ billingohu config set --api-key YOUR_API_KEY
110
43
  ```
111
44
 
112
- ### Available Resources
113
-
114
- - `bank-accounts` (alias: `banks`) - Manage bank accounts
115
- - `documents` (alias: `docs`) - Manage invoices and documents
116
- - `document-blocks` (alias: `blocks`) - Manage invoice pads
117
- - `partners` - Manage customers and suppliers
118
- - `products` - Manage product catalog
119
- - `currencies` (alias: `currency`) - Currency conversion
120
- - `organization` (alias: `org`) - Organization information
121
- - `utils` - Utility functions
122
-
123
- ### Global Options
124
-
125
- - `-f, --format <format>` - Output format: `json` or `pretty` (default: pretty)
126
- - `-h, --help` - Display help for command
127
- - `-v, --version` - Output version number
45
+ Get your API key from [app.billingo.hu/api](https://app.billingo.hu/api)
128
46
 
129
- ## Examples
47
+ ## Commands
130
48
 
131
- ### Bank Accounts
49
+ ### Configuration
132
50
 
133
51
  ```bash
134
- # List all bank accounts
135
- billingo bank-accounts list
136
-
137
- # Get specific account
138
- billingo bank-accounts get 123
139
-
140
- # Create from JSON file
141
- billingo bank-accounts create --file account.json
142
-
143
- # Create from inline JSON
144
- billingo bank-accounts create --data '{"name":"Main Account","account_number":"12345678"}'
52
+ # Set API key
53
+ billingohu config set --api-key <key>
145
54
 
146
- # Update account
147
- billingo bank-accounts update 123 --file updated-account.json
148
-
149
- # Delete account
150
- billingo bank-accounts delete 123
55
+ # Show current config
56
+ billingohu config show
151
57
  ```
152
58
 
153
- ### Documents (Invoices)
59
+ ### Invoices
154
60
 
155
61
  ```bash
156
- # List all documents
157
- billingo documents list --page 1 --per-page 25
158
-
159
- # Filter documents
160
- billingo documents list \
161
- --partner-id 456 \
162
- --payment-status paid \
163
- --start-date 2024-01-01 \
164
- --end-date 2024-12-31
165
-
166
- # Get specific document
167
- billingo documents get 789
168
-
169
- # Create document
170
- billingo documents create --file invoice.json
62
+ # List invoices
63
+ billingohu invoices list
64
+ billingohu invoices list --type invoice --payment-method transfer
171
65
 
172
- # Cancel document
173
- billingo documents cancel 789
66
+ # Get invoice details
67
+ billingohu invoices get <invoice-id>
174
68
 
175
- # Download PDF
176
- billingo documents download 789 --output invoice-789.pdf
69
+ # Create invoice
70
+ billingohu invoices create --data '{...}'
177
71
 
178
- # Send via email
179
- billingo documents send 789 --emails "customer@example.com,accounting@example.com"
72
+ # Send invoice via email
73
+ billingohu invoices send <invoice-id> --emails "client@example.com"
180
74
 
181
- # Get public download URL
182
- billingo documents public-url 789
183
-
184
- # Get payment history
185
- billingo documents payments 789
186
-
187
- # Update payment history
188
- billingo documents update-payments 789 --file payments.json
189
-
190
- # Check Online Számla status
191
- billingo documents online-szamla 789
75
+ # Delete invoice
76
+ billingohu invoices delete <invoice-id>
192
77
  ```
193
78
 
194
- ### Partners
79
+ ### Partners (Customers/Suppliers)
195
80
 
196
81
  ```bash
197
82
  # List partners
198
- billingo partners list
83
+ billingohu partners list
199
84
 
200
- # Get partner
201
- billingo partners get 456
85
+ # Get partner details
86
+ billingohu partners get <partner-id>
202
87
 
203
88
  # Create partner
204
- billingo partners create --file partner.json
89
+ billingohu partners create --data '{"name":"Acme Corp","email":"contact@acme.com"}'
205
90
 
206
91
  # Update partner
207
- billingo partners update 456 --data '{"name":"Updated Name"}'
92
+ billingohu partners update <partner-id> --data '{...}'
208
93
 
209
94
  # Delete partner
210
- billingo partners delete 456
95
+ billingohu partners delete <partner-id>
211
96
  ```
212
97
 
213
98
  ### Products
214
99
 
215
100
  ```bash
216
101
  # List products
217
- billingo products list
102
+ billingohu products list
218
103
 
219
- # Get product
220
- billingo products get 321
104
+ # Get product details
105
+ billingohu products get <product-id>
221
106
 
222
107
  # Create product
223
- billingo products create --file product.json
108
+ billingohu products create --data '{"name":"Service","net_unit_price":10000,"currency":"HUF"}'
224
109
 
225
110
  # Update product
226
- billingo products update 321 --file updated-product.json
111
+ billingohu products update <product-id> --data '{...}'
227
112
 
228
113
  # Delete product
229
- billingo products delete 321
114
+ billingohu products delete <product-id>
230
115
  ```
231
116
 
232
- ### Currency Conversion
117
+ ### Bank Accounts
233
118
 
234
119
  ```bash
235
- # Get conversion rate
236
- billingo currencies convert --from HUF --to EUR
120
+ # List bank accounts
121
+ billingohu bank-accounts list
122
+
123
+ # Get account details
124
+ billingohu bank-accounts get <account-id>
237
125
 
238
- # Get rate in JSON format
239
- billingo currencies convert --from USD --to HUF --format json
126
+ # Create bank account
127
+ billingohu bank-accounts create --data '{...}'
240
128
  ```
241
129
 
242
130
  ### Organization
243
131
 
244
132
  ```bash
245
- # Get organization data
246
- billingo organization get
133
+ # Show organization details
134
+ billingohu organization show
247
135
 
248
- # JSON output
249
- billingo organization get --format json
136
+ # List supported currencies
137
+ billingohu organization currencies
250
138
  ```
251
139
 
252
- ### Utilities
140
+ ## JSON Output
141
+
142
+ All commands support `--json` for machine-readable output:
253
143
 
254
144
  ```bash
255
- # Convert legacy API ID to v3
256
- billingo utils convert-id 12345
257
- ```
145
+ # List invoices as JSON
146
+ billingohu invoices list --json
258
147
 
259
- ### Document Blocks
148
+ # Pipe to jq for filtering
149
+ billingohu invoices list --json | jq '.[] | select(.payment_status == "paid")'
260
150
 
261
- ```bash
262
- # List invoice pads
263
- billingo document-blocks list
151
+ # Get partner details
152
+ billingohu partners get <id> --json
264
153
  ```
265
154
 
266
- ## Data Formats
267
-
268
- ### Creating a Document (Invoice)
155
+ ## Examples
269
156
 
270
- Example `invoice.json`:
157
+ ### Create invoice workflow
271
158
 
272
- ```json
273
- {
274
- "vendor_id": 1,
275
- "partner_id": 123,
276
- "block_id": 1,
159
+ ```bash
160
+ # First, create a partner
161
+ PARTNER_ID=$(billingohu partners create \
162
+ --data '{"name":"Acme Corp","email":"billing@acme.com","city":"Budapest"}' \
163
+ --json | jq -r '.id')
164
+
165
+ # Create invoice
166
+ billingohu invoices create --data '{
167
+ "partner_id": '$PARTNER_ID',
277
168
  "type": "invoice",
278
- "fulfillment_date": "2024-01-15",
279
- "due_date": "2024-01-30",
280
- "payment_method": "transfer",
281
- "language": "hu",
282
169
  "currency": "HUF",
283
170
  "items": [
284
171
  {
285
- "name": "Web Development Service",
286
- "unit_price": 50000,
287
- "quantity": 10,
288
- "unit": "hour",
289
- "vat": "27%"
172
+ "name": "Consulting Services",
173
+ "net_unit_price": 100000,
174
+ "quantity": 1
290
175
  }
291
176
  ]
292
- }
293
- ```
177
+ }'
294
178
 
295
- ### Creating a Partner
296
-
297
- Example `partner.json`:
298
-
299
- ```json
300
- {
301
- "name": "Example Company Ltd.",
302
- "address": {
303
- "country_code": "HU",
304
- "post_code": "1234",
305
- "city": "Budapest",
306
- "address": "Example Street 42"
307
- },
308
- "emails": ["contact@example.com"],
309
- "taxcode": "12345678-1-23"
310
- }
179
+ # Send invoice
180
+ billingohu invoices send <invoice-id> --emails "billing@acme.com"
311
181
  ```
312
182
 
313
- ### Creating a Bank Account
314
-
315
- Example `account.json`:
316
-
317
- ```json
318
- {
319
- "name": "Main Business Account",
320
- "account_number": "12345678-12345678",
321
- "account_number_iban": "HU42123456781234567812345678",
322
- "swift": "ABCDHUHB",
323
- "currency": "HUF",
324
- "need_qr": true
325
- }
326
- ```
327
-
328
- ## Error Handling
329
-
330
- The CLI provides clear error messages for common issues:
331
-
332
- - **401 Unauthorized** - Check your API key
333
- - **403 Forbidden** - Insufficient permissions
334
- - **404 Not Found** - Resource doesn't exist
335
- - **422 Validation Error** - Invalid data format
336
- - **429 Rate Limit** - Too many requests (shows retry time)
337
- - **500 Server Error** - Billingo API issue
338
-
339
- ## Rate Limiting
340
-
341
- The API includes rate limit headers in responses:
342
- - `X-RateLimit-Limit` - Requests allowed per window
343
- - `X-RateLimit-Remaining` - Requests remaining
344
- - `X-RateLimit-Reset` - Reset timestamp
345
-
346
- The CLI warns you when fewer than 10 requests remain.
347
-
348
- ## Development
183
+ ### List unpaid invoices
349
184
 
350
185
  ```bash
351
- # Install dependencies
352
- npm install
353
-
354
- # Run locally
355
- npm run dev -- documents list
356
-
357
- # Run directly
358
- node bin/billingo.js documents list
186
+ billingohu invoices list --json | jq '.[] | select(.payment_status != "paid") | {id, invoice_number, partner_name, total_gross}'
359
187
  ```
360
188
 
361
- ## API Documentation
362
-
363
- - Official API Docs: https://api.billingo.hu/v3/swagger
364
- - Support: https://support.billingo.hu/content/446136358
365
- - Generate API Key: https://app.billingo.hu/api-key
366
-
367
- ## Supported Currencies
189
+ ## Contributing
368
190
 
369
- The API supports 37 currencies including:
370
- HUF, EUR, USD, GBP, CHF, AUD, CAD, DKK, NOK, SEK, CZK, PLN, RON, BGN, HRK, RSD, and more.
191
+ Issues and pull requests are welcome at [github.com/ktmcp-cli/billingohu](https://github.com/ktmcp-cli/billingohu).
371
192
 
372
193
  ## License
373
194
 
374
- MIT
195
+ MIT — see [LICENSE](LICENSE) for details.
375
196
 
376
- ## Support
197
+ ---
377
198
 
378
- For issues and feature requests, please contact support or refer to the official Billingo documentation.
199
+ Part of the [KTMCP CLI](https://killthemcp.com) project replacing MCPs with simple, composable CLIs.
package/bin/billingo.js CHANGED
@@ -1,75 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- /**
4
- * Billingo CLI - Main Entry Point
5
- *
6
- * Production-ready CLI for Billingo API v3
7
- * Hungarian invoicing and billing automation
8
- */
9
-
10
- import { Command } from 'commander';
11
- import { readFileSync } from 'fs';
12
3
  import { fileURLToPath } from 'url';
13
4
  import { dirname, join } from 'path';
14
- import chalk from 'chalk';
15
-
16
- // Import command modules
17
- import { registerBankAccountCommands } from '../src/commands/bank-accounts.js';
18
- import { registerDocumentCommands } from '../src/commands/documents.js';
19
- import { registerDocumentBlockCommands } from '../src/commands/document-blocks.js';
20
- import { registerPartnerCommands } from '../src/commands/partners.js';
21
- import { registerProductCommands } from '../src/commands/products.js';
22
- import { registerCurrencyCommands } from '../src/commands/currencies.js';
23
- import { registerOrganizationCommands } from '../src/commands/organization.js';
24
- import { registerUtilityCommands } from '../src/commands/utilities.js';
25
- import { registerConfigCommands } from '../src/commands/config.js';
26
5
 
27
6
  const __filename = fileURLToPath(import.meta.url);
28
7
  const __dirname = dirname(__filename);
29
8
 
30
- // Load package.json
31
- const packageJson = JSON.parse(
32
- readFileSync(join(__dirname, '../package.json'), 'utf-8')
33
- );
34
-
35
- const program = new Command();
36
-
37
- // Configure main program
38
- program
39
- .name('billingo')
40
- .description(chalk.cyan('Billingo API v3 CLI - Hungarian invoicing and billing automation'))
41
- .version(packageJson.version, '-v, --version', 'output the current version')
42
- .addHelpText('after', `
43
- ${chalk.bold('Examples:')}
44
- $ billingo config set API_KEY <your-api-key>
45
- $ billingo documents list --page 1 --per-page 25
46
- $ billingo documents create -f invoice.json
47
- $ billingo partners list
48
- $ billingo bank-accounts list
49
-
50
- ${chalk.bold('API Documentation:')}
51
- ${chalk.blue('https://api.billingo.hu/v3/swagger')}
52
-
53
- ${chalk.bold('Get API Key:')}
54
- ${chalk.blue('https://app.billingo.hu/api-key')}
55
- `);
56
-
57
- // Register all command modules
58
- registerConfigCommands(program);
59
- registerBankAccountCommands(program);
60
- registerDocumentCommands(program);
61
- registerDocumentBlockCommands(program);
62
- registerPartnerCommands(program);
63
- registerProductCommands(program);
64
- registerCurrencyCommands(program);
65
- registerOrganizationCommands(program);
66
- registerUtilityCommands(program);
67
-
68
- // Global error handler
69
- process.on('unhandledRejection', (error) => {
70
- console.error(chalk.red('Unhandled error:'), error);
71
- process.exit(1);
72
- });
73
-
74
- // Parse command line arguments
75
- program.parse(process.argv);
9
+ // Import and run the main CLI
10
+ import(join(__dirname, '..', 'src', 'index.js'));
package/package.json CHANGED
@@ -1,23 +1,19 @@
1
1
  {
2
2
  "name": "@ktmcp-cli/billingo",
3
- "version": "1.0.0",
4
- "description": "Production-ready CLI for Billingo API v3 - Hungarian invoicing and billing",
3
+ "version": "1.0.1",
4
+ "description": "Production-ready CLI for Billingo API v3 - invoicing, billing, partners",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
- "billingo": "./bin/billingo.js"
9
- },
10
- "scripts": {
11
- "test": "echo \"Error: no test specified\" && exit 1",
12
- "dev": "node bin/billingo.js"
8
+ "billingo": "bin/billingo.js"
13
9
  },
14
10
  "keywords": [
15
11
  "billingo",
16
- "invoice",
12
+ "invoicing",
17
13
  "billing",
18
- "hungary",
19
14
  "cli",
20
- "api"
15
+ "api",
16
+ "ktmcp"
21
17
  ],
22
18
  "author": "KTMCP",
23
19
  "license": "MIT",
@@ -31,5 +27,13 @@
31
27
  },
32
28
  "engines": {
33
29
  "node": ">=18.0.0"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/ktmcp-cli/billingo.git"
34
+ },
35
+ "homepage": "https://killthemcp.com/billingo-cli",
36
+ "bugs": {
37
+ "url": "https://github.com/ktmcp-cli/billingo/issues"
34
38
  }
35
39
  }