Skip to content

Commit 79af24c

Browse files
committed
fix: add help descriptions and updated readme
1 parent f0dde87 commit 79af24c

File tree

3 files changed

+90
-1
lines changed

3 files changed

+90
-1
lines changed

README.md

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,84 @@
11
# dktp
22

3+
A simple cli to interact with Azure ContainerApps with arm/yaml templates
4+
5+
## Usage
6+
7+
```shell
8+
Usage: dktp [options] [command]
9+
10+
CLI to help working dktp apps
11+
12+
Options:
13+
-h, --help display help for command
14+
15+
Commands:
16+
wrap [options] <configfile> [outputfile] Download secrets, and encrypt environment
17+
run [options] <env_file> <command...> Run command with environment variables from lock-file
18+
inspect [options] <env_file> Print content of encrypted lock-file
19+
help [command] display help for command
20+
```
21+
22+
### Wrap: Download and encrypt environment
23+
24+
```shell
25+
Usage: dktp wrap [options] <configfile> [outputfile]
26+
27+
Download secrets, and encrypt environment
28+
29+
Arguments:
30+
configfile Path to dktp yaml file
31+
outputfile Path to encrypted vault file
32+
33+
Options:
34+
-c, --container <container_name> Container name to process (defaults to create a combined env file)
35+
-e, --env <env_file> Envfile to use for interpolation
36+
-h, --help display help for command
37+
38+
39+
Example: dktp wrap example/main.yml -e example/prod.env example/prod.env.locked
40+
```
41+
42+
### Run: Start a process with environment variable set
43+
44+
```shell
45+
Usage: dktp run [options] <env_file> <command...>
46+
47+
Run command with environment variables from lock-file
48+
49+
Arguments:
50+
env_file Envfile to use for process
51+
command The command to run
52+
53+
Options:
54+
-o, --override [keyvalue...] Override or pass extra environment variable, e.g MY_VAR=abba (default: {})
55+
-h, --help display help for command
56+
57+
58+
Example: dktp run example/prod.env.locked -o APP_NAME=Hello -- node index.mjs
59+
```
60+
61+
### Inspect: Print the content of a encrypted lock-file
62+
63+
```shell
64+
Usage: dktp inspect [options] <env_file>
65+
66+
Print content of encrypted lock-file
67+
68+
Arguments:
69+
env_file File to inspect
70+
71+
Options:
72+
-o, --override [keyvalue...] Override or pass extra environment variable, e.g MY_VAR=abba (default: {})
73+
-h, --help display help for command
74+
75+
76+
Example: dktp inspect example/prod.env.locked -o APP_NAME=Hello
77+
```
78+
79+
80+
81+
## Contribution
382
To install dependencies:
483

584
```bash
@@ -12,4 +91,12 @@ To run:
1291
bun run src/index.ts
1392
```
1493

15-
This project was created using `bun init` in bun v1.0.30. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
94+
To test wrapping of secrets;
95+
1. Update [targetPlatform.ts](src/utils/targetPlatform.ts) to set `AZ_MOCK = true`.
96+
2. Run `bun run src/index.ts wrap example/main.yml -e example/prod.env example/prod.env.locked`
97+
98+
99+
### Commiting changes
100+
101+
This repository uses commitizen and conventional-changelog to determine which new semver-version should be used in a release.
102+
To help with keeping your commits correctly formatted please use `bun commit` / `npm run commit`.

src/commands/inspect.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import dotenv from 'dotenv';
88

99
export const inspectCommand: Command = program
1010
.createCommand('inspect')
11+
.description('Print content of encrypted lock-file')
1112
.argument('<env_file>', 'File to inspect')
1213
.option(
1314
'-o, --override [keyvalue...]',

src/commands/run.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { parseEnvEntry } from '../utils/env-utils';
99

1010
export const runCommand: Command = program
1111
.createCommand('run')
12+
.description('Run command with environment variables from lock-file')
1213
.argument('<env_file>', 'Envfile to use for process')
1314
.argument('<command...>', 'The command to run')
1415
.option(

0 commit comments

Comments
 (0)