Compare commits
23 Commits
d592b5f2d8
...
v0.1.10
| Author | SHA1 | Date | |
|---|---|---|---|
|
81e05cf859
|
|||
|
64897d32e4
|
|||
|
0408fe856d
|
|||
|
4e3b711567
|
|||
|
7f0bff57eb
|
|||
|
92f167e7e8
|
|||
|
c7ebd6350e
|
|||
|
d7d55d24f5
|
|||
|
6381c189cb
|
|||
|
d0568e48ec
|
|||
|
f66a6c858d
|
|||
|
267d546d2e
|
|||
|
87c9c36f6c
|
|||
|
2f19707e94
|
|||
|
a79d0ee6d4
|
|||
|
32ad2b3fd7
|
|||
|
0a3a4d4f74
|
|||
|
95f3254f81
|
|||
|
5894bd5bb1
|
|||
|
560f8f4fd0
|
|||
|
e1d8e27c23
|
|||
|
2e19df72b0
|
|||
|
08b3e1cf5b
|
5
.drone.yml
Normal file
5
.drone.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
kind: template
|
||||||
|
load: bust_rustbin_default_template.yaml
|
||||||
|
name: toolkit
|
||||||
|
data:
|
||||||
|
binName: toolkit
|
||||||
89
.github/workflows/release-published.yml
vendored
Normal file
89
.github/workflows/release-published.yml
vendored
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
name: release-published
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
brew-releaser:
|
||||||
|
name: Homebrew releaser
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: Release to homebrew tap
|
||||||
|
uses: Justintime50/homebrew-releaser@v1
|
||||||
|
with:
|
||||||
|
# The name of the homebrew tap to publish your formula to as it appears on GitHub.
|
||||||
|
# Required - strings.
|
||||||
|
homebrew_owner: kjuulh
|
||||||
|
homebrew_tap: homebrew-brew
|
||||||
|
|
||||||
|
# The name of the folder in your homebrew tap where formula will be committed to.
|
||||||
|
# Default is shown - string.
|
||||||
|
formula_folder: formula
|
||||||
|
|
||||||
|
# The GitHub Token (saved as a repo secret) that has `repo` permissions for the homebrew tap you want to release to.
|
||||||
|
# Required - string.
|
||||||
|
github_token: ${{ secrets.BREW_GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# Git author info used to commit to the homebrew tap.
|
||||||
|
# Defaults are shown - strings.
|
||||||
|
commit_owner: kjuulh
|
||||||
|
commit_email: homebrew-releaser@kjuulh.io
|
||||||
|
|
||||||
|
# Custom dependencies in case other formulas are needed to build the current one.
|
||||||
|
# Optional - multiline string.
|
||||||
|
depends_on: |
|
||||||
|
"fzf"
|
||||||
|
"gh"
|
||||||
|
"dust"
|
||||||
|
"bottom"
|
||||||
|
"procs"
|
||||||
|
"sourcegraph/src-cli/src-cli"
|
||||||
|
"tokei"
|
||||||
|
"bandwhich"
|
||||||
|
|
||||||
|
# Custom install command for your formula.
|
||||||
|
# Required - string.
|
||||||
|
install: 'bin.install "toolkit"'
|
||||||
|
|
||||||
|
# Custom test command for your formula so you can run `brew test`.
|
||||||
|
# Optional - string.
|
||||||
|
#test: 'assert_match("my script output", shell_output("my-script-command"))'
|
||||||
|
|
||||||
|
# Adds URL and checksum targets for different OS and architecture pairs. Using this option assumes
|
||||||
|
# a tar archive exists on your GitHub repo with the following URL pattern (this cannot be customized):
|
||||||
|
# https://github.com/{GITHUB_OWNER}/{REPO_NAME}/releases/download/{TAG}/{REPO_NAME}-{VERSION}-{OPERATING_SYSTEM}-{ARCHITECTURE}.tar.gz'
|
||||||
|
# Darwin AMD pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-darwin-amd64.tar.gz
|
||||||
|
# Linux ARM pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-linux-arm64.tar.gz
|
||||||
|
# Optional - booleans.
|
||||||
|
target_darwin_amd64: true
|
||||||
|
target_darwin_arm64: true
|
||||||
|
target_linux_amd64: true
|
||||||
|
target_linux_arm64: true
|
||||||
|
|
||||||
|
# Update your homebrew tap's README with a table of all projects in the tap.
|
||||||
|
# This is done by pulling the information from all your formula.rb files - eg:
|
||||||
|
#
|
||||||
|
# | Project | Description | Install |
|
||||||
|
# | ------------------------------------------ | ------------ | ------------------------ |
|
||||||
|
# | [formula_1](https://github.com/user/repo1) | helpful text | `brew install formula_1` |
|
||||||
|
# | [formula_2](https://github.com/user/repo2) | helpful text | `brew install formula_2` |
|
||||||
|
# | [formula_3](https://github.com/user/repo3) | helpful text | `brew install formula_3` |
|
||||||
|
#
|
||||||
|
# Simply place the following in your README or wrap your project in these comment tags:
|
||||||
|
# <!-- project_table_start -->
|
||||||
|
# TABLE HERE
|
||||||
|
# <!--project_table_end -->
|
||||||
|
#
|
||||||
|
# Finally, mark `update_readme_table` as `true` in your GitHub Action config and we'll do the work of building a custom table for you.
|
||||||
|
# Default is `false` - boolean.
|
||||||
|
update_readme_table: true
|
||||||
|
|
||||||
|
# Skips committing the generated formula to a homebrew tap (useful for local testing).
|
||||||
|
# Default is shown - boolean.
|
||||||
|
skip_commit: false
|
||||||
|
|
||||||
|
# Logs debugging info to console.
|
||||||
|
# Default is shown - boolean.
|
||||||
|
debug: true
|
||||||
81
.github/workflows/release.yml
vendored
81
.github/workflows/release.yml
vendored
@@ -110,82 +110,5 @@ jobs:
|
|||||||
*.deb
|
*.deb
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
*.zip
|
*.zip
|
||||||
name: ${{ steps.get_version.outputs.value }}
|
name: v${{ steps.get_version.outputs.value }}
|
||||||
tag_name: ${{ steps.get_version.outputs.value }}
|
tag_name: v${{ steps.get_version.outputs.value }}
|
||||||
brew-releaser:
|
|
||||||
name: Homebrew releaser
|
|
||||||
needs: [release]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- name: Release to homebrew tap
|
|
||||||
uses: Justintime50/homebrew-releaser@v1
|
|
||||||
if: ${{ github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'chore(release)') }}
|
|
||||||
with:
|
|
||||||
# The name of the homebrew tap to publish your formula to as it appears on GitHub.
|
|
||||||
# Required - strings.
|
|
||||||
homebrew_owner: kjuulh
|
|
||||||
homebrew_tap: brew
|
|
||||||
|
|
||||||
# The name of the folder in your homebrew tap where formula will be committed to.
|
|
||||||
# Default is shown - string.
|
|
||||||
formula_folder: toolkit
|
|
||||||
|
|
||||||
# The GitHub Token (saved as a repo secret) that has `repo` permissions for the homebrew tap you want to release to.
|
|
||||||
# Required - string.
|
|
||||||
github_token: ${{ secrets.BREW_GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
# Git author info used to commit to the homebrew tap.
|
|
||||||
# Defaults are shown - strings.
|
|
||||||
commit_owner: kjuulh
|
|
||||||
commit_email: homebrew-releaser@kjuulh.io
|
|
||||||
|
|
||||||
# Custom dependencies in case other formulas are needed to build the current one.
|
|
||||||
# Optional - multiline string.
|
|
||||||
#depends_on: |
|
|
||||||
|
|
||||||
# Custom install command for your formula.
|
|
||||||
# Required - string.
|
|
||||||
install: 'bin.install "toolkit"'
|
|
||||||
|
|
||||||
# Custom test command for your formula so you can run `brew test`.
|
|
||||||
# Optional - string.
|
|
||||||
#test: 'assert_match("my script output", shell_output("my-script-command"))'
|
|
||||||
|
|
||||||
# Adds URL and checksum targets for different OS and architecture pairs. Using this option assumes
|
|
||||||
# a tar archive exists on your GitHub repo with the following URL pattern (this cannot be customized):
|
|
||||||
# https://github.com/{GITHUB_OWNER}/{REPO_NAME}/releases/download/{TAG}/{REPO_NAME}-{VERSION}-{OPERATING_SYSTEM}-{ARCHITECTURE}.tar.gz'
|
|
||||||
# Darwin AMD pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-darwin-amd64.tar.gz
|
|
||||||
# Linux ARM pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-linux-arm64.tar.gz
|
|
||||||
# Optional - booleans.
|
|
||||||
target_darwin_amd64: true
|
|
||||||
target_darwin_arm64: true
|
|
||||||
target_linux_amd64: true
|
|
||||||
target_linux_arm64: true
|
|
||||||
|
|
||||||
# Update your homebrew tap's README with a table of all projects in the tap.
|
|
||||||
# This is done by pulling the information from all your formula.rb files - eg:
|
|
||||||
#
|
|
||||||
# | Project | Description | Install |
|
|
||||||
# | ------------------------------------------ | ------------ | ------------------------ |
|
|
||||||
# | [formula_1](https://github.com/user/repo1) | helpful text | `brew install formula_1` |
|
|
||||||
# | [formula_2](https://github.com/user/repo2) | helpful text | `brew install formula_2` |
|
|
||||||
# | [formula_3](https://github.com/user/repo3) | helpful text | `brew install formula_3` |
|
|
||||||
#
|
|
||||||
# Simply place the following in your README or wrap your project in these comment tags:
|
|
||||||
# <!-- project_table_start -->
|
|
||||||
# TABLE HERE
|
|
||||||
# <!--project_table_end -->
|
|
||||||
#
|
|
||||||
# Finally, mark `update_readme_table` as `true` in your GitHub Action config and we'll do the work of building a custom table for you.
|
|
||||||
# Default is `false` - boolean.
|
|
||||||
update_readme_table: true
|
|
||||||
|
|
||||||
# Skips committing the generated formula to a homebrew tap (useful for local testing).
|
|
||||||
# Default is shown - boolean.
|
|
||||||
skip_commit: false
|
|
||||||
|
|
||||||
# Logs debugging info to console.
|
|
||||||
# Default is shown - boolean.
|
|
||||||
debug: true
|
|
||||||
|
|||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -316,7 +316,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toolkit"
|
name = "toolkit"
|
||||||
version = "0.1.1"
|
version = "0.1.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"eyre",
|
"eyre",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "toolkit"
|
name = "toolkit"
|
||||||
description = "Toolkit is an opinionated toolkit complementing a personal development workflow. Many of the commands are quite verbose, and well suited for adding to your shell toolbelt"
|
description = "Toolkit is an opinionated toolkit complementing a personal development workflow. Many of the commands are quite verbose, and well suited for adding to your shell toolbelt"
|
||||||
version = "0.1.1"
|
version = "0.1.10"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license-file = "LICENSE"
|
license-file = "LICENSE"
|
||||||
authors = ["Kasper J. Hermansen contact@kjuulh.io"]
|
authors = ["Kasper J. Hermansen contact@kjuulh.io"]
|
||||||
|
|||||||
60
README.md
60
README.md
@@ -1 +1,61 @@
|
|||||||
# Toolkit
|
# Toolkit
|
||||||
|
|
||||||
|
This is an opinionated toolkit, which reflect my (@kjuulh) way of working. This
|
||||||
|
project aims to enhance a general workflow, and provides tools that may be
|
||||||
|
useful outside of project work. For project work see repo:kjuulh/bust or
|
||||||
|
repo:kjuulh/char, which aims for the same thing, but for projects themselves.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Currenly I only publish homebrew packages, however, all artifacts are released
|
||||||
|
via. released, that includes deb packages as well.
|
||||||
|
|
||||||
|
### Homebrew
|
||||||
|
|
||||||
|
```
|
||||||
|
brew install kjuulh/brew/toolkit
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
To use toolkit you will need a series of environment variables, they are only
|
||||||
|
needed if you need the associated tool.
|
||||||
|
|
||||||
|
```
|
||||||
|
export SRC_ENDPOINT=https://sourcegraph.com
|
||||||
|
export SRC_ACCESS_TOKEN=
|
||||||
|
export GITHUB_FC_ROOT="/Users/<username>/git/github.com"
|
||||||
|
export GITHUB_FC_ORGS="kjuulh"
|
||||||
|
```
|
||||||
|
|
||||||
|
`SRC` is sourcegraph integration. The endpoint is either to the public instance,
|
||||||
|
or your own domain. The access token is a personal access token. If either of
|
||||||
|
these are missing. A prompt will be shown on the first run
|
||||||
|
|
||||||
|
`GITHUB_FC` is the fuzzy clone setup. First is the destination path, this is
|
||||||
|
where the orgs will be placed. Second is ORGS, that is which orgs to subscribe
|
||||||
|
to. The total path in this case will end up being
|
||||||
|
`/Users/<username>/git/github.com/kjuulh`.
|
||||||
|
|
||||||
|
You will also require other integration such as a GitHub integration through
|
||||||
|
`gh`.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
Usage: toolkit <COMMAND>
|
||||||
|
|
||||||
|
Commands:
|
||||||
|
prereqs
|
||||||
|
tldr
|
||||||
|
sourcegraph
|
||||||
|
github
|
||||||
|
stats
|
||||||
|
init
|
||||||
|
help Print this message or the help of the given subcommand(s)
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h, --help Print help information
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|||||||
BIN
assets/demo.gif
Normal file
BIN
assets/demo.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 MiB |
@@ -202,12 +202,12 @@ impl FuzzyClone {
|
|||||||
}),
|
}),
|
||||||
)?;
|
)?;
|
||||||
} else {
|
} else {
|
||||||
util::shell::run(
|
let _ = util::shell::run(
|
||||||
&["git", "pull"],
|
&["git", "pull"],
|
||||||
Some(util::shell::RunOptions {
|
Some(util::shell::RunOptions {
|
||||||
path: git_repo_path.clone(),
|
path: git_repo_path.clone(),
|
||||||
}),
|
}),
|
||||||
)?;
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(git_repo_path)
|
Ok(git_repo_path)
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
use std::{borrow::Borrow, ffi::OsString};
|
|
||||||
|
|
||||||
pub struct Search;
|
pub struct Search;
|
||||||
|
|
||||||
impl util::Cmd for Search {
|
impl util::Cmd for Search {
|
||||||
@@ -12,8 +10,8 @@ impl util::Cmd for Search {
|
|||||||
fn exec(args: &clap::ArgMatches) -> eyre::Result<()> {
|
fn exec(args: &clap::ArgMatches) -> eyre::Result<()> {
|
||||||
match args.subcommand() {
|
match args.subcommand() {
|
||||||
Some((external, args)) => {
|
Some((external, args)) => {
|
||||||
let mut raw = args
|
let raw = args
|
||||||
.get_many::<OsString>("")
|
.get_many::<std::ffi::OsString>("")
|
||||||
.ok_or(eyre::anyhow!("please pass some args to search"))?
|
.ok_or(eyre::anyhow!("please pass some args to search"))?
|
||||||
.map(|s| s.as_os_str())
|
.map(|s| s.as_os_str())
|
||||||
.map(|s| s.to_string_lossy().to_string())
|
.map(|s| s.to_string_lossy().to_string())
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ pub struct Perf;
|
|||||||
|
|
||||||
impl Perf {
|
impl Perf {
|
||||||
fn run() -> eyre::Result<()> {
|
fn run() -> eyre::Result<()> {
|
||||||
if let Err(_) = util::shell::run_with_input_and_output(&["ytop", "--version"], "".into()) {
|
if let Err(_) = util::shell::run_with_input_and_output(&["btm", "--version"], "".into()) {
|
||||||
return Err(eyre::anyhow!(
|
return Err(eyre::anyhow!(
|
||||||
"could not find ytop, please install or add to PATH"
|
"could not find btm, please install or add to PATH"
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
util::shell::run(&["ytop"], None)?;
|
util::shell::run(&["btm"], None)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ impl Procs {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
util::shell::run(&["procs"], None)?;
|
util::shell::run_with_input(&["procs"], "".into())?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ impl util::Cmd for Update {
|
|||||||
let mut tldr_cache_dir = cache_dir.clone();
|
let mut tldr_cache_dir = cache_dir.clone();
|
||||||
tldr_cache_dir.push("kah-toolkit/tldr/store/");
|
tldr_cache_dir.push("kah-toolkit/tldr/store/");
|
||||||
|
|
||||||
std::fs::remove_dir_all(&tldr_cache_dir)?;
|
if let Err(_) = std::fs::remove_dir_all(&tldr_cache_dir) {
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
std::fs::create_dir_all(&tldr_cache_dir)?;
|
std::fs::create_dir_all(&tldr_cache_dir)?;
|
||||||
|
|
||||||
util::shell::run(
|
util::shell::run(
|
||||||
|
|||||||
Reference in New Issue
Block a user