Skip to content

Commit 5b36c84

Browse files
docs: left-justify prerequisite tables
1 parent a214876 commit 5b36c84

File tree

12 files changed

+291
-61
lines changed

12 files changed

+291
-61
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "interactive"
3+
}

src/site/markdown/building.md.vm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This guide explains how to build the OSCAL CLI from source code.
55
## Prerequisites
66

77
| Requirement | Minimum Version | Notes |
8-
|-------------|-----------------|-------|
8+
|:------------|:----------------|:------|
99
| Java JDK | 17 | Required for building (output JARs are JDK 11 compatible) |
1010
| Maven | 3.9.0 | Required for building |
1111
| Git | 2.0 | Required for cloning |
@@ -128,6 +128,16 @@ docker build -t oscal-cli:local .
128128
docker run --rm oscal-cli:local --help
129129
```
130130

131+
## Building the Site
132+
133+
To build the project documentation site:
134+
135+
```bash
136+
mvn site
137+
```
138+
139+
The generated site appears in `target/site/`.
140+
131141
## Common Build Issues
132142

133143
### Submodule Not Initialized

src/site/markdown/claude-integration.md.vm

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Claude Code plugins provide specialized skills for:
1515
## Prerequisites
1616

1717
1. [Install Claude Code](https://docs.anthropic.com/en/docs/claude-code)
18-
2. Ensure the OSCAL plugins are available in your configuration
18+
2. Install the [Metaschema plugins](https://github.com/metaschema-framework/claude-plugins/tree/main)
1919

2020
## Available Plugins
2121

@@ -24,23 +24,23 @@ Claude Code plugins provide specialized skills for:
2424
Skills for working with OSCAL documents:
2525

2626
| Skill | Description |
27-
|-------|-------------|
27+
|:------|:------------|
2828
| `oscal:oscal-basics` | OSCAL document types and structure |
2929

3030
### OSCAL Tools Plugin
3131

3232
Skills for using the CLI:
3333

3434
| Skill | Description |
35-
|-------|-------------|
35+
|:------|:------------|
3636
| `oscal-tools:using-oscal-cli` | Running oscal-cli commands |
3737

3838
### Metaschema Plugin
3939

4040
Skills for understanding OSCAL's underlying structure:
4141

4242
| Skill | Description |
43-
|-------|-------------|
43+
|:------|:------------|
4444
| `metaschema:metaschema-basics` | Introduction to Metaschema concepts |
4545
| `metaschema:metapath-expressions` | Writing Metapath queries |
4646

@@ -108,6 +108,8 @@ oscal-cli metapath eval -e "//control" catalog.json
108108

109109
## Learn More
110110

111+
For more information about Claude Code, OSCAL, and the CLI, see these resources:
112+
111113
- [Claude Code Documentation](https://docs.anthropic.com/en/docs/claude-code)
112114
- [OSCAL Documentation](https://pages.nist.gov/OSCAL/)
113115
- [CLI Reference](guides/cli-reference.html)

src/site/markdown/guides/cli-reference.md.vm

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# CLI Reference
22

3-
Complete reference for all oscal-cli commands.
3+
This page provides a complete reference for all oscal-cli commands and options. For task-oriented guides, see the individual guide pages linked at the bottom.
44

55
## Global Options
66

7-
These options are available for all commands:
7+
These options work with any command and control the general behavior of the CLI:
88

99
| Option | Description |
10-
|--------|-------------|
10+
|:-------|:------------|
1111
| `--help`, `-h` | Show help for any command |
1212
| `--version`, `-V` | Show version information |
1313
| `--show-stack-trace` | Show detailed error information |
@@ -26,13 +26,13 @@ oscal-cli validate [options] <file>
2626
**Arguments:**
2727

2828
| Argument | Description |
29-
|----------|-------------|
29+
|:---------|:------------|
3030
| `<file>` | Path or URL to OSCAL document |
3131

3232
**Options:**
3333

3434
| Option | Description |
35-
|--------|-------------|
35+
|:-------|:------------|
3636
| `--as=<format>` | Force input format: `xml`, `json`, `yaml` |
3737

3838
**Examples:**
@@ -54,7 +54,7 @@ oscal-cli validate --show-stack-trace ssp.json
5454
**Exit Codes:**
5555

5656
| Code | Meaning |
57-
|------|---------|
57+
|:-----|:--------|
5858
| 0 | Validation passed |
5959
| 1 | Validation failed |
6060
| 2 | Invalid arguments |
@@ -72,14 +72,14 @@ oscal-cli convert [options] <source> [destination]
7272
**Arguments:**
7373

7474
| Argument | Description |
75-
|----------|-------------|
75+
|:---------|:------------|
7676
| `<source>` | Input file path or URL |
7777
| `[destination]` | Output file path (optional, stdout if omitted) |
7878

7979
**Options:**
8080

8181
| Option | Description |
82-
|--------|-------------|
82+
|:-------|:------------|
8383
| `--to=<format>` | Output format: `xml`, `json`, `yaml` (required) |
8484
| `--as=<format>` | Input format: `xml`, `json`, `yaml` |
8585
| `--overwrite` | Overwrite existing output file |
@@ -110,14 +110,14 @@ oscal-cli resolve-profile [options] <profile> [catalog]
110110
**Arguments:**
111111

112112
| Argument | Description |
113-
|----------|-------------|
113+
|:---------|:------------|
114114
| `<profile>` | Input profile file or URL |
115115
| `[catalog]` | Output catalog file (optional, stdout if omitted) |
116116

117117
**Options:**
118118

119119
| Option | Description |
120-
|--------|-------------|
120+
|:-------|:------------|
121121
| `--to=<format>` | Output format: `xml`, `json`, `yaml` |
122122
| `--as=<format>` | Input format: `xml`, `json`, `yaml` |
123123
| `--overwrite` | Overwrite existing output file |
@@ -152,13 +152,13 @@ oscal-cli metapath eval [options] -e <expression> <file>
152152
**Arguments:**
153153

154154
| Argument | Description |
155-
|----------|-------------|
155+
|:---------|:------------|
156156
| `<file>` | Input file to query |
157157

158158
**Options:**
159159

160160
| Option | Description |
161-
|--------|-------------|
161+
|:-------|:------------|
162162
| `-e <expression>` | Metapath expression to evaluate (required) |
163163
| `--to=<format>` | Output format: `xml`, `json`, `yaml` |
164164

@@ -188,7 +188,7 @@ oscal-cli generate-completion <shell>
188188
**Arguments:**
189189

190190
| Argument | Description |
191-
|----------|-------------|
191+
|:---------|:------------|
192192
| `<shell>` | Shell type: `bash` or `zsh` |
193193

194194
**Examples:**
@@ -205,12 +205,13 @@ oscal-cli generate-completion zsh > _oscal-cli
205205

206206
## OSCAL Document Types
207207

208-
The CLI recognizes these OSCAL document types automatically:
208+
The CLI automatically detects the document type by examining the root element. You don't need to specify the document type—validation and conversion work for all types:
209209

210210
| Type | Root Element |
211-
|------|--------------|
211+
|:-----|:-------------|
212212
| Catalog | `catalog` |
213213
| Profile | `profile` |
214+
| Mapping | `mapping-collection` |
214215
| System Security Plan | `system-security-plan` |
215216
| Component Definition | `component-definition` |
216217
| Assessment Plan | `assessment-plan` |
@@ -219,10 +220,10 @@ The CLI recognizes these OSCAL document types automatically:
219220

220221
## Format Detection
221222

222-
File formats are detected by extension:
223+
The CLI determines input format from the file extension. This works for most cases:
223224

224225
| Extension | Format |
225-
|-----------|--------|
226+
|:----------|:-------|
226227
| `.xml` | XML |
227228
| `.json` | JSON |
228229
| `.yaml`, `.yml` | YAML |
@@ -231,23 +232,29 @@ Use `--as` to override detection for files with non-standard extensions.
231232

232233
## Environment Variables
233234

235+
The CLI respects standard Java environment variables for configuration:
236+
234237
| Variable | Description |
235-
|----------|-------------|
238+
|:---------|:------------|
236239
| `JAVA_HOME` | Java installation directory |
237240
| `JAVA_OPTS` | JVM options (e.g., `-Xmx2g`) |
238241

239242
## Container Reference
240243

244+
When using Docker, the following tags and options are available:
245+
241246
### Image Tags
242247

243248
| Tag | Description |
244-
|-----|-------------|
249+
|:----|:------------|
245250
| `latest` | Latest stable release |
246251
| `x.y.z` | Specific version |
247252
| `develop` | Latest development build |
248253

249254
### Volume Mounting
250255

256+
Mount local directories to make your files accessible inside the container:
257+
251258
```bash
252259
# Mount current directory
253260
docker run --rm -v "$(pwd):/data" ghcr.io/metaschema-framework/oscal-cli:latest ...
@@ -258,6 +265,8 @@ docker run --rm -v "/path/to/files:/data" ghcr.io/metaschema-framework/oscal-cli
258265

259266
### Resource Limits
260267

268+
For large documents, you may need to increase container memory or CPU limits:
269+
261270
```bash
262271
# Limit memory
263272
docker run --rm -m 2g ghcr.io/metaschema-framework/oscal-cli:latest ...

src/site/markdown/guides/converting-formats.md.vm

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@
22

33
This guide explains how to convert OSCAL documents between XML, JSON, and YAML formats.
44

5+
## Why Convert?
6+
7+
OSCAL supports three serialization formats—XML, JSON, and YAML—with identical semantics across all three. Organizations often need to convert between formats for various reasons:
8+
9+
- **Tooling requirements** - Different tools in your workflow may require specific formats
10+
- **Standardization** - Establishing a single canonical format for your organization
11+
- **Human readability** - YAML is often preferred for manual editing, XML for transformation
12+
- **Integration** - APIs and web services typically prefer JSON
13+
- **Storage efficiency** - JSON is generally more compact than XML
14+
15+
The OSCAL CLI makes conversion simple. Because OSCAL defines format-agnostic semantics, you can convert documents without data loss—the information remains identical regardless of format.
16+
517
## Overview
618

7-
The `convert` command transforms OSCAL documents between supported formats while preserving all content and structure.
19+
The `convert` command transforms OSCAL documents between supported formats while preserving all content and structure. The command reads the input document, validates it against the OSCAL model, and writes it in the target format.
820

921
## Basic Conversion
1022

@@ -34,15 +46,15 @@ oscal-cli convert --to=json component.yaml component.json
3446

3547
## Format Detection
3648

37-
The CLI automatically detects the input format based on file extension:
49+
The CLI determines the input format automatically by examining the file extension. This makes typical conversions simple—you only need to specify the desired output format:
3850

3951
| Extension | Format |
40-
|-----------|--------|
52+
|:----------|:-------|
4153
| `.xml` | XML |
4254
| `.json` | JSON |
4355
| `.yaml`, `.yml` | YAML |
4456

45-
To override automatic detection:
57+
If your file uses a non-standard extension (or no extension), you can override automatic detection:
4658

4759
```bash
4860
oscal-cli convert --as=xml --to=json input.txt output.json
@@ -66,6 +78,8 @@ oscal-cli convert --to=json --overwrite catalog.xml catalog.json
6678

6779
## Converting All OSCAL Document Types
6880

81+
Conversion works the same way for all OSCAL document types. The CLI detects the document type from the content and applies the appropriate conversion rules. Here are examples for each type:
82+
6983
### Catalogs
7084

7185
```bash
@@ -78,6 +92,12 @@ oscal-cli convert --to=json NIST_SP-800-53_catalog.xml NIST_SP-800-53_catalog.js
7892
oscal-cli convert --to=xml FedRAMP_HIGH_profile.json FedRAMP_HIGH_profile.xml
7993
```
8094

95+
### Mappings
96+
97+
```bash
98+
oscal-cli convert --to=json mapping.xml mapping.json
99+
```
100+
81101
### System Security Plans
82102

83103
```bash
@@ -105,6 +125,8 @@ oscal-cli convert --to=json poam.xml poam.json
105125

106126
## Batch Conversion
107127

128+
When migrating a collection of documents to a new format, shell scripting handles the repetitive work. The following examples show how to convert multiple files at once:
129+
108130
### Convert All XML to JSON
109131

110132
#[[
@@ -127,6 +149,8 @@ find . -name "*.xml" -exec sh -c '
127149

128150
## Container Usage
129151

152+
Docker provides a convenient way to run conversions without installing Java locally. Mount your working directory into the container to access your files:
153+
130154
#[[
131155
```bash
132156
# Convert a single file
@@ -145,6 +169,8 @@ docker run --rm -v "$(pwd):/data" \
145169

146170
## CI/CD Integration
147171

172+
Automated format conversion is useful when publishing artifacts—for example, generating JSON versions of XML source files when creating a release:
173+
148174
### GitHub Actions - Convert on Release
149175

150176
#[[
@@ -166,10 +192,12 @@ docker run --rm -v "$(pwd):/data" \
166192

167193
## Format Considerations
168194

195+
Choosing a format depends on your use case. Each format has trade-offs that may influence your decision. The following tables summarize the key differences:
196+
169197
### XML vs JSON
170198

171199
| Aspect | XML | JSON |
172-
|--------|-----|------|
200+
|:-------|:----|:-----|
173201
| Human readability | Good with formatting | Good |
174202
| File size | Larger | Smaller |
175203
| Comments | Supported | Not supported |
@@ -179,7 +207,7 @@ docker run --rm -v "$(pwd):/data" \
179207
### YAML vs JSON
180208

181209
| Aspect | YAML | JSON |
182-
|--------|------|------|
210+
|:-------|:-----|:-----|
183211
| Human readability | Excellent | Good |
184212
| Editing | Easy | Standard |
185213
| Comments | Supported | Not supported |
@@ -188,6 +216,8 @@ docker run --rm -v "$(pwd):/data" \
188216

189217
## Troubleshooting
190218

219+
When conversion fails, the error messages point to the issue. Here are solutions for common problems:
220+
191221
### Invalid Input Format
192222

193223
```
@@ -215,6 +245,8 @@ oscal-cli convert --to=xml input.json output.xml
215245

216246
## Next Steps
217247

248+
Continue learning about the OSCAL CLI with these related guides:
249+
218250
- [Validating OSCAL](validating-oscal.html) - Validate before converting
219251
- [Resolving Profiles](resolving-profiles.html) - Resolve profiles to catalogs
220252
- [CLI Reference](cli-reference.html) - Complete command reference

0 commit comments

Comments
 (0)