fastTravelCLI is a fast, lightweight, and feature rich CD command replacement.
fastTravelCLI provides robust bookmarking, navigation history, useful fuzzy finders (powered by fzf), and more.
fastTravelCLI is being continuously improved, check out the issues for new features, support, and integrations in the works.
Installation
Clone the repo, cd into it, and run the following based on your OS –
bash install/linux.sh
bash install/mac.sh
Disclaimers
Currently available for Unix-like OS and bash/zsh shells. May work in more shell environments but not guaranteed.
Compiles using go version >= 1.20.0, may work with older versions but not guaranteed.
# Go to a directory you would like to add a bookmark for and run
ft -set [key]
# You can also explicitly set a key to a directory, or set multiple at once
ft -set key1=some/other/dir key2=./some/relative/path
# Travel to a location by running
ft [key]
# fastTravelCLI evaluates keys to their absolute filepath, so you can do stuff like this
ft [key]/some/subdir
# ft can replace your cd command entirely and respects CDPATH
ft relative/dir
ft ..
ft -
ft mydir
# To remove a bookmark run
ft -rm [key]
# To rename a bookmark run
ft -rn [key] [new key]
# ft allows you to visit previously visited directories in your current session
ft [
# Traverse back up your dir history using
ft ]
# fastTravelCLI has fzf integrations# The default behavior of ft is to pull up fzf with all your bookmarks
ft
# View immediate child directories in a given project (current project by default) in fzf
ft -f
ft -f mykey
ft -f my/project/dir
# View all child directories in a given project in fzf
ft -fa
ft -fa mykey
ft -fa my/project/dir
# You can also view your session history in fzf
ft -hist
# View all your bookmarks with
ft -ls
# fastTravelCLI accepts args piped to it and is highly scriptableecho"mykey=some/project/path"> myfile.txt
cat myfile.txt | ft -set
# if you change a directory's name on your machine, you can easily update fastTravelCLI
ft -edit my/old/dirname newdirname
# ft is easy to update to the latest release
ft -update
# or
ft -u
# you can also specify a specific version or latest
ft -u v.0.2.92
# To see a full list of available commands run
ft -help
# or
ft -h
# You can get more detailed help with a specific command
ft -set -help
# or
ft -set -h
Contributing
PRs and feature suggestions are welcome. I originally made this for myself but if others find it useful and have feedback I’m open to it.
Getting Started
To set up the project locally for development, clone the repo and ensure you have the following installed –
Docker
go 1.22+
python 3.11+
lua 5.4+
GNU Make 4.4+
Run all tests by running the default make command or make all.
Documentation Site
To run the docs site locally add a python virtual environment to the project.
python3 -m venv venv
Activate the virtual environment and install mkdocs and mkdocs-material.
Finally, make sure that Python path is correctly set. The commmand
which python
should display the path to the Anaconda’s environment Python path, e.g., /opt/anaconda3/envs/StrainNet/bin/python
Downloading pre-trained models and data
To download the data and pretrained models for this project, you can use the download.sh script. This script will download the data and models from a remote server and save them to your local machine.
Warning: The data is approximately 15 GB in size and may take some time to download.
To download the data and models, run the following command:
. scripts/download.sh
This will download the data and models and save them to the current working directory. See the datasets for all of the ultrasound images (both synthetic and experimentally collected) and see the models folder for the pre-trained StrainNet models.
Demo: Applying StrainNet to a Synthetic Test Case
To see a demo of StrainNet in action, you can apply the model to a synthetic test case. The synthetic test case is a simulated image with known strains that can be used to test the accuracy of the model.
To apply StrainNet to the synthetic test case, use the following command:
. scripts/demo.sh
You should now see a results folder with some plots of the performance on a synthetic test case where the largest strain is $4%$ (see the 04DEF in StrainNet/datasets/SyntheticTestCases/04DEF).
After generating a training, StrainNet can be trained. To train StrainNet, you will need to run the train.py script. This script can be invoked from the command line, and there are several optional arguments that you can use to customize the training process.
Here is an example command for training StrainNet with the default settings:
python train.py
You can also adjust the training settings by specifying command-line arguments. For example, to change the optimizer and learning rate, you can use the following command:
python train.py --optimizer SGD --lr 0.01
Arguments
Below is a list of some of the available command-line arguments that you can use to customize the training process:
Argument
Default
Description
--optimizer
Adam
The optimizer to use for training.
--lr
0.001
The learning rate to use for the optimizer.
--batch_size
8
The batch size to use for training.
--epochs
100
The number of epochs to train for.
--train_all
False
Whether to train all of the models.
For a complete list of available command-line arguments and their descriptions, you can use the --help flag:
By default, train.py will only train one of the four models needed for StrainNet. To train all the models needed for StrainNet, you can use the train.sh script. This script will invoke the necessary training scripts and pass the appropriate arguments to them.
To run the train.sh script, simply execute the following command from the terminal:
. scripts/train.sh
Viewing the progress of your training with Tensorboard
By default, running train.py will write an events.out file to visualize the progress of training StrainNet with Tensorboard. After running train.py, locate the events.out in the newly-created runs folder.
Viewing the Tensorboard Webpage
To view the Tensorboard webpage, you will need to start a Tensorboard server. You can do this by running the following command in the terminal:
Replace "path/to/dir/containing/events.out" with a path to a folder containing events.out file(s) (e.g., runs). This will start a Tensorboard server and print a message with a URL that you can use to access the Tensorboard webpage.
To view the Tensorboard webpage, open a web browser and navigate to the URL printed by the Tensorboard server. This will open the Tensorboard webpage, which allows you to view various training metrics and graphs.
To view the Tensorboard events.out file in Visual Studio Code, you may use the Tensorboard command.
Open the command palette (View → Command Palette… or Cmd + Shift + P on macOS)
Type “Python: Launch Tensorboard” in the command palette and press Enter.
Select Select another folder and select the runs folder to view events.out file(s).
Evaluating the performance of StrainNet
After training the model, you can evaluate its performance on a test dataset to see how well it generalizes to unseen data. To evaluate the model, you will need to have a test dataset in a format that the model can process.
To evaluate the model, you can use the eval.py script. This script loads the trained model and the test dataset, and runs the model on the test data to compute evaluation metrics such as accuracy and precision.
To run the eval.py script, use the following command:
To apply the pretrained models to the synthetic test cases, you can use the eval.sh script. This script will invoke the necessary evaluation scripts and pass the appropriate arguments to them.
To run the eval.sh script, simply execute the following command from the terminal:
. scripts/eval.sh
Citation
@article{huff2024strainnet,
title={Deep learning enables accurate soft tissue tendon deformation estimation in vivo via ultrasound imaging},
author={Huff, Reece D and Houghton, Frederick and Earl, Conner C and Ghajar-Rahimi, Elnaz and Dogra, Ishan and Yu, Denny and Harris-Adamson, Carisa and Goergen, Craig J and O’Connell, Grace D},
journal={Scientific Reports},
volume={14},
number={1},
pages={18401},
year={2024},
publisher={Nature Publishing Group UK London}
}
LICENSE
This project is licensed under the MIT License – see the LICENSE file for details.
use v6.c;
use META6::bin :HELPER;
&META6::bin::try-to-fetch-url.wrap({
say "checking URL: ⟨$_⟩";
callsame;
});
META6::bin::MAIN(:check);
General Options
--meta6-file=<path-to-META6.json> # defaults to ./META6.json
Create Options
--name
--description
--version # defaults to 0.0.1
--perl # defaults to 6.c
--author # defaults to user/name from ~/.gitconfig
--auth # defaults to credentials/username from ~/.gitconfig
New Module Options
--new-module=<Module::Name::Here>
--description="some text" # added both META6.json and README.md
--base-dir # the $*CWD for all local file operations
Will create a new module project in a new directory with a name prefixed with create.prefix (default raku-), setup git, push it to github (See Github
below). The skeleton from the config dir ~/.meta6 will be applied (see Config
Dir below).
Fork Module Options
--fork-module=<Module::Name::Here> # module name as to be found in the ecosystem
This will seach a module by name in the ecosystem. If it’s a github repo that
repo will be forked and cloned to the local FS. If there is a META6.info but
no t/meta.t, the file and its dependancy will be added and commited to the
local git repo.
Pull Request Options
--pull-request
--title=`git log|head 1` # defaults to last commit message
--message=''
--head=master # branch in your fork
--base=master # branch in upstream repo
--repo-name # defaults to repo name provided in META6.info
Pull request need to tell github where to create the PR at. That in turn
requires a proper META6.json to get the repo name from.
Releasing a module
To create a release on github use --release. The optional parameter --version takes a string that is used as a version and stored in the
META6.json-file. Versions can be incremented with +, ++, +++ for the
parts of a version with the form 1.2.3. A single + will change the
revision, ++ the miner version and +++ the major.
A github-tag will be created and is the base of the release. The source-url
field in the META6.json is set to the tarball of the release on github.
Config Dir
The config dir resides at ~/.meta6 and holds a folder called skeleton for
additional files to be copied into any new project. This is where you put your
default LICENSE or alternate .gitignore.
The config dir, a default meta6.cfg and its default subdirs are created with --create-cfg-dir.
Any executable under pre-create.d, post-create.d and post-push.d are
sorted and executed with a timeout of 60 seconds each. Files that end in ~
are filtered out.
The config directory can hold a github-token.txt file that is used to help curl to connect to github. The token
needs the scopes repo, user/read:user and user/email. Please note that git itself can handle a ~/.netrc-file and github will accept a token
instead of a password.
Github
To be able to talk to github your git-config requires a section as follows.