https://github.com/mosch/toml-tool
a cli tool for reading and manipulating toml files
https://github.com/mosch/toml-tool
cli toml toml-config
Last synced: 3 months ago
JSON representation
a cli tool for reading and manipulating toml files
- Host: GitHub
- URL: https://github.com/mosch/toml-tool
- Owner: mosch
- Created: 2021-07-14T20:29:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-15T10:13:45.000Z (about 5 years ago)
- Last Synced: 2025-01-28T21:18:18.532Z (over 1 year ago)
- Topics: cli, toml, toml-config
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# toml-tool
Simple cli tool for reading and manipulating toml files.
## Usage
```
toml-tool [command]
Commands:
toml-tool get
toml-tool set --category.foo="bar" --category.my.foo="bar"
Options:
--help Show help [boolean]
--version Show version number [boolean]
-w, --write Write changes back to file [boolean]
```
### Using with yarn / npm
You can use this tool in your script with npm & yarn like so:
```
yarn toml-tool set myconfig.toml ...
yarn toml-tool get myconfig.toml myvalue
```
### Exmaples
```
hello = "world"
[production]
hello = "foo"
[development]
hello = "bar"
```
#### Manipulating
```
toml-tool set test.toml --hello=my --production.hello=cat
hello = "my"
[production]
hello = "cat"
[development]
hello = "bar"
```
*To write the changes into the file add the -w (write) flag*
#### Reading
```
toml-tool get test.toml hello
world
```
```
toml-tool get test.toml hello.production
foo
```
```
toml-tool get test.toml hello.development
bar
```