Skip to content

Commit

Permalink
Adjust README instructions with community feedback (#21)
Browse files Browse the repository at this point in the history
* Installation and usage docs first for #16

Since we will presumably have more people using
the pre-built version than locally building the
tool to add features and fix bugs, we should put
this information earlier in the README.

* Minor typo fix, permamently->permanently.

* Maven plugin downloads, formatting of code blocks

This commit adds more information on quickly and
effectively using Maven. Also, I added ` ```sh`
fences to code blocks for shell commands. I also
added example of adding to shell configuration
files.
  • Loading branch information
aj-stein-gsa authored Sep 14, 2024
1 parent a8f2f57 commit c106179
Showing 1 changed file with 49 additions and 28 deletions.
77 changes: 49 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,62 +22,83 @@ Thank you for interest in contributing to the Metaschema Java framework. For com

This project is in the worldwide [public domain](LICENSE.md) and as stated in [CONTRIBUTING.md](CONTRIBUTING.md).

## Building

This project can be built with [Apache Maven](https://maven.apache.org/) version 3.8.4 or greater.

The following instructions can be used to clone and build this project.

1. Clone the GitHub repository.

```bash
git clone --recurse-submodules https://github.com/usnistgov/oscal-cli.git
```

2. Build the project with Maven

```bash
mvn install
```

## Installing

### Installing pre-built Java package

1. Make a directory to install oscal-cli and cd into it. The example below uses the directory `/opt/oscal-cli`. Use your preferred directory.

```sh
mkdir -p /opt/oscal-cli
```
mkdir -p /opt/oscal-cli && cd /opt/oscal-cli
```
NOTE:

2. Download the zipped oscal-cli Java package. Download your preferred version, but we recommend [the latest stable release on the Maven Central repository](https://central.sonatype.com/artifact/dev.metaschema.oscal/oscal-cli/).
2. Download the zipped oscal-cli Java package to the install directory. Download your preferred version, but we recommend [the latest stable release on the Maven Central repository](https://central.sonatype.com/artifact/dev.metaschema.oscal/oscal-cli/). You can use [the Maven tool](https://maven.apache.org/) instead of in place of additional command line tools (i.e. `curl`; `wget`; etc.) or browser to craft URLs for a specific version.

3. Extract oscal-cli into the directory.
```sh
mvn \
org.apache.maven.plugins:maven-dependency-plugin:LATEST:copy \
-DoutputDirectory=/opt/oscal-cli \
-DremoteRepositories=https://repo1.maven.org/maven2 \
-Dartifact=dev.metaschema.oscal:oscal-cli-enhanced:LATEST:zip:oscal-cli
```
unzip cli-core-1.0.1-oscal-cli.zip

3. Move, extract oscal-cli, and delete the zipped package from the install directory.

```sh
cd /opt/oscal-cli
unzip *.zip
rm *.zip
```

4. (Recommended) Add oscal-cli's directory to your path.
```

```sh
# temporarily add oscal-cli to your terminal's instance path
PATH=$PATH:/opt/oscal-cli/bin

# add oscal-cli to your environment (e.g., all terminals)
export PATH=$PATH:/opt/oscal-cli/bin
```
NOTE: You can also add oscal-cli's directory to your path in shell profile to make oscal-cli permamently available.

## Running
5. You can optionally add oscal-cli's directory to your path in shell profile (i.e. [`$HOME/.bashrc`](https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html); [`$HOME/.zshrc`](https://zsh.sourceforge.io/Guide/zshguide02.html); etc.) to make oscal-cli permanently available.

Run help to make sure everything work
```sh
# You do not need to use both, pick one.
# Use the command below for bash shells.
echo 'export PATH=$PATH:/opt/oscal-cli/bin' >> ~/.bashrc
# Use this command for zsh shells.
echo 'export PATH=$PATH:/opt/oscal-cli/bin' >> ~/.zshrc
```

## Running

Run help to make sure everything works.

```sh
# if oscal-cli directory added to your path
oscal-cli --help

# if you did not add oscal-cli directory to your path
/opt/oscal-cli/bin/oscal-cli --help
```

## Building

This project can be built with [Apache Maven](https://maven.apache.org/) version 3.8.4 or greater.

The following instructions can be used to clone and build this project.

1. Clone the GitHub repository.

```bash
git clone --recurse-submodules https://github.com/usnistgov/oscal-cli.git
```

2. Build the project with Maven

```bash
mvn install
```

## Relationship to prior work

Expand Down

0 comments on commit c106179

Please sign in to comment.