Skip to content

Commit 478ea45

Browse files
authored
Merge pull request #3 from TouK/dev
release
2 parents eb71bc3 + a71127a commit 478ea45

15 files changed

Lines changed: 81 additions & 24 deletions

cli/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ node_modules/
55
dist/
66

77
# Config files (contains secrets)
8-
.nu-cli.yaml
8+
nu-config.yaml
99
*.yaml
1010
!src/templates/*.yaml.template
1111

cli/.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ coverage/
1818
# Config files
1919
.env
2020
.env.*
21-
.nu-cli.yaml
21+
nu-config.yaml
2222

2323
# CI/CD
2424
.github/

cli/.releaserc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"master",
44
{
55
"name": "dev",
6+
"channel": "beta",
67
"prerelease": "beta"
78
}
89
],

cli/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## [1.0.1-beta.2](https://github.com/TouK/nu-cloud-lab/compare/v1.0.1-beta.1...v1.0.1-beta.2) (2026-02-18)
2+
3+
### Bug Fixes
4+
5+
* trigger build ([023352e](https://github.com/TouK/nu-cloud-lab/commit/023352e9b94d399c72e54d3c4bf0c0b0ad6833a2))
6+
7+
## [1.0.1-beta.1](https://github.com/TouK/nu-cloud-lab/compare/v1.0.0...v1.0.1-beta.1) (2026-02-18)
8+
9+
### Bug Fixes
10+
11+
* beta tag fixed ([a55f07b](https://github.com/TouK/nu-cloud-lab/commit/a55f07b18a84dfccfcc2e6c6faa4449ceed40921))
12+
* config and message template ([3e93efc](https://github.com/TouK/nu-cloud-lab/commit/3e93efcc2e602e94810a4421dde108647087ded7))
13+
114
## 1.0.0 (2026-02-18)
215

316
### Bug Fixes

cli/README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ nu-cli init --no-interactive # Use template
5252
nu-cli init -o myconfig.yaml # Custom output path
5353
```
5454

55+
**Creates:**
56+
- `nu-config.yaml` - Configuration file
57+
- `message-template.yaml` - Default message template
58+
5559
**Interactive prompts:**
5660
- Nu Cloud API URL
5761
- Username
@@ -82,7 +86,7 @@ nu-cli send --profile production --data '{"event": "user_login"}'
8286
**Priority:** `--data` > `--file` > `--template` > config template > default template
8387

8488
**Options:**
85-
- `-C, --config <path>` - Config file path (default: `.nu-cli.yaml`)
89+
- `-C, --config <path>` - Config file path (default: `nu-config.yaml`)
8690
- `-p, --profile <name>` - Config profile to use
8791
- `-d, --data <json>` - Message data as JSON/YAML string
8892
- `-f, --file <path>` - Message data from file (JSON/YAML)
@@ -104,7 +108,7 @@ nu-cli produce --template custom.yaml # Use custom template
104108
```
105109

106110
**Options:**
107-
- `-C, --config <path>` - Config file path (default: `.nu-cli.yaml`)
111+
- `-C, --config <path>` - Config file path (default: `nu-config.yaml`)
108112
- `-p, --profile <name>` - Config profile to use
109113
- `-d, --delay <seconds>` - Delay between messages (overrides config)
110114
- `-t, --template <path>` - Template file to use (overrides config)
@@ -213,7 +217,7 @@ nu-cli schema -o schema.avsc # Save to file
213217

214218
## Configuration
215219

216-
### Basic config (`.nu-cli.yaml`)
220+
### Basic config (`nu-config.yaml`)
217221

218222
```yaml
219223
api:
@@ -223,7 +227,7 @@ api:
223227

224228
producer:
225229
delay_seconds: 1
226-
# template_path: "./custom-template.yaml" # Optional: custom message template
230+
template_path: "./message-template.yaml" # Path to message template (created by init)
227231
```
228232
229233
**Optional Authentication:**
@@ -295,7 +299,7 @@ price: "faker:commerce.price(10,1000)"
295299
**Use it:**
296300

297301
```bash
298-
# In .nu-cli.yaml
302+
# In nu-config.yaml
299303
producer:
300304
template_path: "./my-template.yaml"
301305
@@ -449,7 +453,7 @@ nu-cli consume --no-tunnel
449453
Run `nu-cli init` to create a config file, or specify a custom path with `--config`.
450454

451455
### "Invalid or placeholder password"
452-
Edit your `.nu-cli.yaml` and set a real password (not `your_password`).
456+
Edit your `nu-config.yaml` and set a real password (not `your_password`).
453457

454458
### "cloudflared not found"
455459
Install cloudflared or use `--no-tunnel` flag:

cli/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nussknacker/cli",
3-
"version": "1.0.0",
3+
"version": "1.0.1-beta.2",
44
"description": "CLI tool for Nussknacker Cloud - produce and consume messages",
55
"type": "module",
66
"bin": {

cli/src/commands/init.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const initCommand = new Command('init')
1515
.description('Initialize configuration file')
1616
.option('-i, --interactive', 'Interactive mode (default)', true)
1717
.option('--no-interactive', 'Non-interactive mode (use template)')
18-
.option('-o, --output <path>', 'Output file path', '.nu-cli.yaml')
18+
.option('-o, --output <path>', 'Output file path', 'nu-config.yaml')
1919
.action(async (options) => {
2020
try {
2121
let config: NuCloudConfig;
@@ -62,7 +62,8 @@ export const initCommand = new Command('init')
6262
password: answers.password
6363
},
6464
producer: {
65-
delay_seconds: answers.delay
65+
delay_seconds: answers.delay,
66+
template_path: './message-template.yaml'
6667
}
6768
};
6869

@@ -81,6 +82,17 @@ export const initCommand = new Command('init')
8182
const outputPath = path.resolve(options.output);
8283
await fs.writeFile(outputPath, yaml.stringify(config), 'utf-8');
8384

85+
// Copy message template next to config
86+
const messageTemplateSrc = path.join(__dirname, 'message-template.yaml.template');
87+
const messageTemplateDst = path.join(path.dirname(outputPath), 'message-template.yaml');
88+
89+
try {
90+
await fs.copyFile(messageTemplateSrc, messageTemplateDst);
91+
logger.success(`Message template created: ${messageTemplateDst}`);
92+
} catch (error) {
93+
logger.warn('Could not copy message template - using built-in default');
94+
}
95+
8496
logger.success(`Configuration file created: ${outputPath}`);
8597

8698
if (!options.interactive) {

cli/src/commands/produce.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { logger } from '../utils/logger.js';
77

88
export const produceCommand = new Command('produce')
99
.description('Send messages to Nu Cloud continuously')
10-
.option('-C, --config <path>', 'Config file path', '.nu-cli.yaml')
10+
.option('-C, --config <path>', 'Config file path', 'nu-config.yaml')
1111
.option('-p, --profile <name>', 'Config profile to use')
1212
.option('-d, --delay <seconds>', 'Delay between messages (overrides config)', parseFloat)
1313
.option('-t, --template <path>', 'Template file to use (overrides config)')

cli/src/commands/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { logger } from '../utils/logger.js';
88

99
export const schemaCommand = new Command('schema')
1010
.description('Generate Avro schema from message template')
11-
.option('-C, --config <path>', 'Config file path', '.nu-cli.yaml')
11+
.option('-C, --config <path>', 'Config file path', 'nu-config.yaml')
1212
.option('-p, --profile <name>', 'Config profile to use')
1313
.option('-t, --template <path>', 'Template file to use (overrides config)')
1414
.option('-o, --output <path>', 'Output file (stdout if not specified)')

0 commit comments

Comments
 (0)