https://github.com/sirkon/portalctl
portalctl and portal make diving into "deep" directories easy!
https://github.com/sirkon/portalctl
qol quality-of-life shell shell-users
Last synced: 2 months ago
JSON representation
portalctl and portal make diving into "deep" directories easy!
- Host: GitHub
- URL: https://github.com/sirkon/portalctl
- Owner: sirkon
- License: mit
- Created: 2025-03-08T16:48:52.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-07-24T07:46:02.000Z (11 months ago)
- Last Synced: 2025-07-24T11:33:48.345Z (11 months ago)
- Topics: qol, quality-of-life, shell, shell-users
- Language: Go
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# portalctl
`portalctl` and `portal` make diving into "deep" directories easy!
# Installation
```shell
go install github.com/sirkon/portalctl@latest # Install portalctl.
portalctl setup # Adds portal to your shell and do some other stuff.
```
# What it is and how to use.
Imagine we have a project with deep hierachy of folders. You may do something like
`cd project/internal/libray/internal/sublibrary/…/destination` one time, two times, but it quickly becomes
bothersome once you need to do this again and again and again. Meh.
`portalctl` and `portal` are means to do this pretty easy. The usage scenario with them is:
- Once in a directory you run
```shell
portalctl here
```
Where `` is some identifier.
- When you need to cd in that folder again you just
```shell
portal
```
And your `bash` or `zsh` will move you there.
# More on the `portalctl`.
You can do some management with it:
| command | info |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `here ` | Adds current directory under the given name - a new portal. |
| `delete ` | Removes both name and path once registered with `here` under the given name. |
| `show ` | Prints a path once registered under the given name. |
| `list` | List all available "portals" with name and its path. |
| `prefix ` | List all names having the given `` |
| `log-compact` | Removes all log entries related to removed portals. |
| `version` | Prints version and exits. |
| `setup` | Registers `` shell function. Registers shell completion for ``. `` is just `portal` by default. Can be customized, see help for the `setup` command. |
# What is under the hood.
`portalctl` works like a database:
- once you do "write" type operations, it adds a new record to a log file placed in `/portalctl/`.
- it reads records in the log file and do a response logic once you do "read" type operation. It is always "full scan",
so that's why `log-compact` is provided. Albeit, the log shouldn't be that huge to really care about this: there are
only a few directories you need to go into regularly in any reasonable scenario.