Skip to content

add support for docker and more commads for git#41

Merged
AnderssonPeter merged 5 commits intoAnderssonPeter:mainfrom
Juanma7882:main
Sep 23, 2025
Merged

add support for docker and more commads for git#41
AnderssonPeter merged 5 commits intoAnderssonPeter:mainfrom
Juanma7882:main

Conversation

@Juanma7882
Copy link
Contributor

Added a new dictionary for Docker in PowerType, enabling autocomplete for common Docker commands and parameters.

✅ Main changes

Created the docker.ps1 dictionary file.

Implemented basic commands (docker run, docker build, docker ps, etc.).

Integrated with PSReadLine to provide real-time suggestions.

🔍 Notes

This initial dictionary covers the most commonly used commands, but it can be extended with more subcommands in future updates.

Tested on Windows with PowerShell 7.2.

@AnderssonPeter
Copy link
Owner

Thanks for your PR, I will try to get to it this week!

Name = "Containers";
Description = "List of running containers";
CommandExpression = { docker ps --format "{{.Names}}" };
Cache = [Cache]@{ ByTime = New-TimeSpan -Seconds 10 }
Copy link
Owner

@AnderssonPeter AnderssonPeter Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be extended with ByCommand = @("kill", "run", "stop", "start", "rm", "pause", "purge") to force a update when any of the listed commands are run. (Same goes for $allContainers, but there you can exclude stop, start and pause?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to add the stop, start, and pause commands all at once. I'm adding them at the end, and I think I know how to add ByCommand = @("kill", "run", "stop", "start", "rm", "pause").
$containers = [DynamicSource]@{
Name = "Containers";
Description = "List of running containers";
CommandExpression = {
docker ps --format "{{.Names}}"
};
Cache = [Cache]@{
ByCurrentWorkingDirectory = $true;
ByTime = New-TimeSpan -Seconds 10;
ByCommand = @("kill", "run", "stop", "start","rm","pause")
}
}

$allContainers = [DynamicSource]@{
Name = "All Containers";
Description = "List of all containers (running + stopped)";
CommandExpression = {
docker ps -a --format "{{.Names}}"
};
Cache = [Cache]@{
ByCurrentWorkingDirectory = $true;
ByTime = New-TimeSpan -Seconds 10 ;
ByCommand = @("kill", "run", "stop", "start","rm","pause")
}
}
Is that okay?

README.md Outdated
# How it works
PowerType integrates with **PSReadLine** to provide command predictions.
It works by:
- Reading your command history (for context and suggestions).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In it's current form powertype does not read you history, but it does act on executed commands, to clear caches

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, better delete that line.

  • Reading your command history (for context and suggestions).

README.md Outdated
- [Uninstall](#uninstall)
- [Troubleshooting](#troubleshooting)
- [Progress](#progress)
- [How it works](#How it works)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link doesn't work correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected
The problem was that you had to keep everything together "how it works"
How it works

@Juanma7882
Copy link
Contributor Author

In theory, I've finished the new changes. I hope they're okay. I'll send the pull request in a few moments. What I also did was use the same format you used in Git in Docker so it maintains the same structure. If anything, let me know. I can continue with more changes tomorrow.

@AnderssonPeter
Copy link
Owner

Thanks for your fast response, and thanks for contributing, I will try to review, merge and release this week!

@AnderssonPeter AnderssonPeter merged commit a66cd34 into AnderssonPeter:main Sep 23, 2025
2 of 7 checks passed
@AnderssonPeter
Copy link
Owner

@Juanma7882 a new release with your changes plus a few of mine should soon be up 0.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants