create-rust-github-repo 0.4.0

`create-rust-github-repo` is a CLI program that creates a new repository on GitHub, clones it locally, initializes a Rust project, copies the configs from a pre-existing directory.
Documentation

Create Rust GitHub repo

Build Documentation

Overview

create-rust-github-repo is a CLI program that creates a new repository on GitHub, clones it locally, initializes a Rust project, copies the configs from a pre-existing directory.

Examples

# Create a GitHub repo & init a Rust project
create-rust-github-repo --name my-new-project

# Copy configs from existing project
create-rust-github-repo --name my-new-project --copy-configs-from ~/workspace/my-existing-project --configs .github,rustfmt.toml,clippy.toml

# Clone to a specific directory
create-rust-github-repo --name my-new-project --dir ~/workspace/my-new-project

# Create a public repo
create-rust-github-repo --name my-new-project --repo-create-cmd "gh repo create --public {{name}}"

# Create a lib instead of bin
create-rust-github-repo --name my-new-project --project-init-cmd "cargo init --lib"

Features

  • Uses existing gh, git, cargo commands
  • Supports overrides for all commands
  • Supports substitutions (see help below)
  • Can be used as a library

Installation

cargo install create-rust-github-repo

Usage

`create-rust-github-repo` is a CLI program that creates a new repository on GitHub, clones it locally, initializes a Rust project, copies the configs from a pre-existing directory.

Usage: create-rust-github-repo [OPTIONS] --name <NAME>

Options:
  -n, --name <NAME>
          Repository name
  -d, --dir <DIR>
          Target directory for cloning the repository (must include the repo name) (defaults to "{current_dir}/{repo_name}") (see also: --workspace)
  -w, --workspace <WORKSPACE>
          Parent of the target directory for cloning the repository (must NOT include the repo name). If this option is specified, then the repo is cloned to "{workspace}/{repo_name}". The --dir option overrides this option
      --shell-cmd <SHELL_CMD>
          Shell to use for executing commands [default: /bin/sh]
  -c, --copy-configs-from <COPY_CONFIGS_FROM>
          Source directory for config paths
      --configs <CONFIGS>
          Config paths separated by comma (relative to `copy_configs_from`) (only applies if `copy_configs_from` is specified) (supports files and directories)
      --repo-exists-cmd <REPO_EXISTS_CMD>
          Shell command to check if repo exists (supports substitutions - see help below) [default: "gh repo view --json nameWithOwner {{name}} 2>/dev/null"]
      --repo-create-cmd <REPO_CREATE_CMD>
          Shell command to create a repo (supports substitutions - see help below) [default: "gh repo create --private {{name}}"]
      --repo-clone-cmd <REPO_CLONE_CMD>
          Shell command to clone a repo (supports substitutions - see help below) [default: "gh repo clone {{name}} {{dir}}"]
      --project-init-cmd <PROJECT_INIT_CMD>
          Shell command to initialize a project (supports substitutions - see help below) [default: "cargo init"]
      --project-test-cmd <PROJECT_TEST_CMD>
          Shell command to test a project (supports substitutions - see help below) [default: "cargo test"]
      --repo-add-args <REPO_ADD_ARGS>
          Shell command to add new files (supports substitutions - see help below) [default: "git add ."]
      --repo-commit-args <REPO_COMMIT_ARGS>
          Shell command to make a commit (supports substitutions - see help below) [default: "git commit -m \"Setup project\""]
      --repo-push-args <REPO_PUSH_ARGS>
          Shell command to push the commit (supports substitutions - see help below) [default: "git push"]
  -h, --help
          Print help
  -V, --version
          Print version

All command arg options support the following substitutions:
* {{name}} - substituted with --name arg
* {{dir}} - substituted with resolved directory for repo (the resolved value of --dir)

Additional binaries

  • create-rust-github-private-bin
  • create-rust-github-private-lib
  • create-rust-github-public-bin
  • create-rust-github-public-lib
  • create-rust-keybase-private-bin

Gratitude

Like the project? Say thanks! ❤️

License

Apache License 2.0 or MIT License at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.