Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Env Cli

Laravel Env Cli Laravel Package

tamer-dev/laravel-env-cli

View on GitHub
Deep Wiki
Context7

laravel commands to work with .env file in cli (this package same like https://github.com/imliam/laravel-env-set-command but have some more commands , features and resolved issues)

Frequently asked questions about Laravel Env Cli
How do I install tamer-dev/laravel-env-cli?
Run composer require tamer-dev/laravel-env-cli in your Laravel project. The package registers its Artisan commands through Laravel package auto-discovery, so a manual service provider entry is usually unnecessary. If you only use it for local development or deployment scripts, installing it as a dev dependency keeps your production vendor tree smaller. Check the README for the exact version constraint before pinning.
What Artisan commands does laravel-env-cli add?
It provides CLI commands for working with the .env file, covering setting, reading, listing, and removing environment variables. It follows the same idea as imliam/laravel-env-set-command but adds more commands and features. Run php artisan list to see the exact command names in your installed version, since signatures can change between releases.
Does laravel-env-cli support Laravel 10?
Yes. The 1.2.0 release added Laravel 10 support together with PHP 8.1, so the package is usable on a Laravel 10 stack. Whether Laravel 9 remains supported in that release depends on whether the illuminate constraints were widened or hard-bumped, so diff composer.json before upgrading. Laravel 11 and 12 support is not confirmed by the available release notes.
Which PHP versions can I use with this package?
PHP 8.1 is the minimum indicated by the 1.2.0 release notes. PHP 8.2 and 8.3 are likely fine for a small CLI library, but they are not explicitly documented in the evidence available. PHP 8.4 compatibility is unverified, so exercise it in CI before relying on it.
How is it different from imliam/laravel-env-set-command?
The main difference is scope: imliam's package centres on an env:set style command, while tamer-dev/laravel-env-cli adds more commands and features for everyday .env work. The author also notes resolved issues and newer framework support. For a fair comparison, check command signatures, quoting behaviour, and Laravel version constraints in both READMEs.
Can I set an .env value from the command line without breaking quotes or spaces?
Yes, that is the core use case: you pass a key and value to the Artisan command and it writes the entry into .env. Values containing spaces, hashes, or quotes are the usual failure point in any .env writer, so test those cases explicitly. Back up .env and diff the result the first few times you use it in a pipeline.
How do I list or read a single .env variable from the CLI?
The package includes read and list style commands so you can inspect .env entries without opening the file. This is handy in deployment scripts where you need to confirm a key exists before proceeding. Use php artisan help with the command name to see the exact options available in your installed version.
Is it safe to modify .env in production with this package?
It can be used in deployment automation, but treat .env edits as production changes: back up the file, restrict permissions, and run config:clear or config:cache afterwards so Laravel does not serve stale configuration. If configuration is cached, changes to .env have no effect until the cache is rebuilt. Avoid running it interactively on production hosts.
How do I test code that changes the .env file?
Point the commands at a temporary fixture .env rather than the real one, then assert the file contents after the command runs. In Laravel feature tests you can invoke the command through the artisan test helper and read the fixture back. Always restore or discard the fixture so tests stay isolated and parallel-safe.
Does laravel-env-cli preserve comments and formatting in .env?
A well-behaved .env editor rewrites only the target key and leaves surrounding lines intact, and that is the expectation here, but the available evidence does not guarantee comment or ordering preservation. Verify with a diff on a copy of your .env before adopting it in a workflow. Test with comments, blank lines, and values containing special characters present.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource