codemetagenerator

command module
v0.47.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

codemetagenerator

GitHub go ci build GitHub Release

This project is a CodeMeta project description generator written in Go.

Installation

Manually

To install this project, you need to have Go installed on your machine. Once you have Go installed, you can clone this repository and build the project.

git clone https://github.com/cacoco/codemetagenerator.git
cd codemetagenerator
go build

Then install via go install

Via Homebrew
brew tap cacoco/tap
brew install codemetagenerator

Usage

To run this project, you can use the following commands:

codemetagenerator --help
Commands
Available Commands:
  add         Adds resources [authors, contributors, keywords] to the in-progress codemeta.json file
  clean       Clean the $HOME/.codemetagenerator directory
  delete      Delete an arbitrary key and its value from the in-progress codemeta.json file.
  generate    Generate the final codemeta.json file to the optional output file or to the console
  help        Help about any command
  licenses    List (or refresh cached) SPDX license IDs
  new         Start a new codemeta.json file. When complete, run "codemetagenerator generate" to generate the final codemeta.json file
  set         Set the value of an arbitrary key in the in-progress codemeta.json file.
New

To start a new codemeta.json file:

codemetagenerator new

This will walk you through an interactive session and will store an "in-progress" codemeta.json file. The expectation is that you will continue to add more metadata, e.g., author, contributor, or keyword.

Add

Add helps with the addition of 3 specific fields: author, contributor, or keyword. The command provides a wizard for adding these values.

For example to add an author:

codemetagenerator add author

will walk you through an interactive session to create a Person or Organization author. This command can be run multiple times to add more authors. Similarly, this can also be done for adding one or more contributors:

codemetagenerator add contributor

Again, this command can be run multiple times to add more contributors.

To add one or more keywords:

codemetagenerator add keyword "Java" "JVM" "etc"

The keyword command accepts multiple terms but can also be run multiple times to add more keywords.

Delete

Properties can be removed by running the delete command. This allows for removing any value in the codemeta.json file for a given key specified via the Path Syntax.

codemetagenerator delete "version"
Set

New properties can be inserted or exisiting properties can be updated in the codemeta.json file with the set command. Keys must be specified via the Path Syntax.

codemetagenerator set "relatedLink" "https://thisisrelated.org"
Generate

Once creating and editing are done, you can run generate to produce a final codemeta.json. Generation accepts an optional -o | --output flag that allows for specifying an output file. If this flag is not provided, the output is sent to the console.

codemetagenerator generate
Path Syntax

The syntax follows the sjson (https://github.com/tidwall/sjson) Path Syntax.

CodeMeta

CodeMeta is a JSON-LD file format used to describe software projects. See a full example.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

Apache License 2.0

Copyright 2024 Christopher Coco

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
json
Based on https://github.com/tidwall/sjson but modified to use https://github.com/ohler/ojg instead of encoding/json.
Based on https://github.com/tidwall/sjson but modified to use https://github.com/ohler/ojg instead of encoding/json.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL