Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust README instructions with community feedback #21

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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