{"id":28072750,"url":"https://github.com/ficcdaf/smartcd.fish","last_synced_at":"2025-05-12T21:18:12.482Z","repository":{"id":288662577,"uuid":"968417476","full_name":"ficcdaf/smartcd.fish","owner":"ficcdaf","description":"Mirrored from https://git.sr.ht/~ficd/smartcd.fish","archived":false,"fork":false,"pushed_at":"2025-04-18T20:23:19.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T21:18:09.567Z","etag":null,"topics":["fish-plugin","fish-plugins"],"latest_commit_sha":null,"homepage":"https://git.sr.ht/~ficd/smartcd.fish","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ficcdaf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-18T03:54:56.000Z","updated_at":"2025-04-18T20:23:22.000Z","dependencies_parsed_at":"2025-04-19T08:27:14.941Z","dependency_job_id":"3f36a92b-7c0b-4992-87ed-9df683c4eff3","html_url":"https://github.com/ficcdaf/smartcd.fish","commit_stats":null,"previous_names":["ficcdaf/smartcd.fish"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficcdaf%2Fsmartcd.fish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficcdaf%2Fsmartcd.fish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficcdaf%2Fsmartcd.fish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficcdaf%2Fsmartcd.fish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ficcdaf","download_url":"https://codeload.github.com/ficcdaf/smartcd.fish/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253823486,"owners_count":21969851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fish-plugin","fish-plugins"],"created_at":"2025-05-12T21:18:11.937Z","updated_at":"2025-05-12T21:18:12.466Z","avatar_url":"https://github.com/ficcdaf.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smartcd.fish\n\n\u003e Part of my [utilities collection](https://sr.ht/~ficd/utils/).\n\u003e\n\u003e `cd`, but _slightly_ smarter.\n\n`smartcd` makes `cd` smarter when used without arguments. It adapts based on\nyour current location, helping you more around Git repos and your system more\nefficiently. It works inside the [fish](https://fishshell.com/) shell.\n\n## Usage\n\nThe command is accessible as `cd`:\n\n```fish\n# arguments work as before\ncd /foo/bar\n# including - to go backwards manually\ncd -\n# running cd _without_ arguments\n# triggers the smart behavior\ncd\n# help is also available\ncd --help\n```\n\n- `ROOT`:\n  - Repository root if **inside** a Git repository.\n  - `$HOME` if **_not_ inside** a Git repository.\n- `PREV`:\n  - Your _previous_ directory.\n  - Last element of `$dirprev`.\n\nWhen you invoke `cd` without arguments:\n\n- If not at `ROOT`, return to `ROOT`.\n- If _already_ at `ROOT`, return to `PREV`.\n- If `PREV` is _not_ a child of `ROOT`, prompt before jumping.\n\nAn update function, `smartcd_update`, is provided. It uses `curl` to save the\nlatest version of `smartcd.fish` to `$fish_config/conf.d`.\n\n## Installation\n\nTo install, copy [smartcd.fish](./smartcd.fish) to your `conf.d` directory. Use\n`exec` to reinitialize `fish` if you want to use `smartcd` in the same session.\n\n```fish\ncurl https://git.sr.ht/~ficd/smartcd.fish/blob/main/smartcd.fish \\\n    -o $fish_config/conf.d/smartcd.fish\nexec fish\n```\n\nOnce installed, `smartcd` provides an update function. You may invoke it at any\ntime to update `smartcd` to the latest version. Pass `-d` or `--dry` to print\nthe script to `STDOUT` without saving the file.\n\n```fish\n# Check connectivity \u0026 print script to STDOUT\nsmartcd_update --dry\n# Update conf.d\nsmartcd_update\n# View help\nsmartcd_update --help\n```\n\n## License\n\n[ISC](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fficcdaf%2Fsmartcd.fish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fficcdaf%2Fsmartcd.fish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fficcdaf%2Fsmartcd.fish/lists"}