About jxcape
jxcape is a tool for creating JSON values from the command line.
Strings
To convert a value into a JSON string, use the string subcommand:
It can also take input from stdin:
|
Arrays
To convert a value into a JSON array, use the array subcommand:
By default, jxscape will treat all input as strings. To treat input as native JSON, use the --auto flag:
Any value that cannot be parsed as JSON will be treated as a string.
It can also take input from stdin:
|
If for some reason you need an empty array, you can use the --empty flag:
This is included mostly for completeness.
Objects
To convert a value into a JSON object, use the object subcommand:
}
By default, jxscape will treat all input as strings. To treat input as native JSON, use the --auto flag:
}
Any value that cannot be parsed as JSON will be treated as a string.
It can also take input from stdin:
|
} # truncated for brevity
You can specify a custom separator using the --separator flag:
}
Separators can be multiple characters:
}
If a key is specified multiple times, the last value to appear will be used:
}
If for some reason you need an empty object, you can use the --empty flag:
}
This is included mostly for completeness.
Pretty Printing
To pretty print a JSON value, use the --pretty flag before the subcommand:
[
Installation
Pre-built Binaries
Download the latest release for your platform from the releases page.
Available platforms:
- Linux (x86_64):
jxcape-linux-x86_64.tar.gz - macOS (x86_64):
jxcape-macos-x86_64.tar.gz - macOS (ARM64):
jxcape-macos-aarch64.tar.gz - Windows (x86_64):
jxcape-windows-x86_64.zip
Extract the archive and add the binary to your PATH.
From Crates.io
From Source
Releasing
This project uses an automated release process. To create a new release:
- Update the version in
Cargo.toml - Update the changelog by running
just changelog(requires git-cliff) - Commit the changes:
git commit -am "chore: bump version to X.Y.Z" - Create and push a tag:
git tag vX.Y.Z && git push origin vX.Y.Z
The release workflow will automatically:
- Build binaries for multiple platforms
- Create a GitHub release with changelog content
- Upload compressed binary assets
- Publish the crate to crates.io
Prerequisites for Releases
- The
CRATES_IO_TOKENsecret must be configured in the repository settings - The version in
Cargo.tomlshould match the tag (without the 'v' prefix) - All quality checks (tests, clippy) must pass