Skip to content

This script enhances the usage of `dotnet ef` commands in Zsh by enabling tab completion and providing useful aliases for common commands.

License

Notifications You must be signed in to change notification settings

rouisaek/dotnet-ef-zsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Dotnet EF Aliases and Completions Zsh

This script enhances the usage of dotnet ef commands in Zsh by enabling tab completion and providing useful aliases for common commands.

Features

  • Tab Completion: Provides autocompletion for dotnet ef commands in Zsh.
  • Command Aliases: Shortened aliases for frequently used dotnet ef commands.

Installation

  1. Copy the script into your Zsh configuration file (e.g., ~/.zshrc).
  2. Restart your terminal or run source ~/.zshrc to apply the changes.

Tab Completion

The script adds tab completion for dotnet ef commands. If dotnet is not installed or completions fail to generate, an error message is displayed.

Aliases

Alias Command Description
defdd dotnet ef database drop Drop the database
defdu dotnet ef database update Update the database
defci dotnet ef dbcontext info Get DbContext info
defcls dotnet ef dbcontext list List DbContexts
defco dotnet ef dbcontext optimize Optimize DbContext
defcs dotnet ef dbcontext scaffold Scaffold DbContext from database
defma dotnet ef migrations add Add a new migration
defmls dotnet ef migrations list List migrations
defmr dotnet ef migrations remove Remove the last migration
defms dotnet ef migrations script Generate SQL script from migrations
defv dotnet ef --version Check EF Core version

Helper Command

Use defhelp to list all available aliases:

defhelp

This will output:

Dotnet EF Aliases:
  defdd    - Drop the database
  defdu    - Update the database
  defci    - Get DbContext info
  defcls   - List DbContexts
  defco    - Optimize DbContext
  defcs    - Scaffold DbContext from database
  defma    - Add a new migration
  defmls   - List migrations
  defmr    - Remove the last migration
  defms    - Generate SQL script from migrations
  defv     - Check EF Core version

Notes

  • This script is specific to Zsh.
  • Ensure that dotnet and dotnet ef are installed before using this script.
  • The script checks for dotnet availability before enabling completion.

License

This project is open-source and available under the MIT License.

About

This script enhances the usage of `dotnet ef` commands in Zsh by enabling tab completion and providing useful aliases for common commands.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages