# man > CPAN::Plugin::Specfile

---
type: CommandReference
command: CPAN::Plugin::Specfile
mode: perldoc
section: 3perl
source: perldoc
---

## Quick Reference
- `o conf plugin_list push CPAN::Plugin::Specfile` — Enable the plugin in the CPAN shell
- `o conf commit` — Make the plugin list persistent across sessions
- `test Acme::Meta` — Run tests; on success, writes a specfile for the distribution
- `o conf plugin_list pop` — Disable the plugin (if it is the last in the list)

## Name
Proof of concept implementation of a trivial [CPAN::Plugin](http://localhost/phpMan.php/perldoc/CPAN%3A%3APlugin/markdown) that writes specfiles after successful test runs.

## Synopsis
shell
# Enable the plugin
o conf plugin_list push CPAN::Plugin::Specfile
o conf commit

# Run tests and generate a specfile
test Acme::Meta

# Disable (last in list)
o conf plugin_list pop

# Or remove by index, e.g. position 3
o conf plugin_list
o conf plugin_list splice 3 1
## Options
- `dir` — Target directory for spec files. Set during plugin activation:  
  `o conf plugin_list push CPAN::Plugin::Specfile=dir,/path/to/directory`  
  Default: `plugins/CPAN::Plugin::Specfile` inside the CPAN home directory.

## Examples
**Enable with custom directory**
shell
o conf plugin_list push CPAN::Plugin::Specfile=dir,/tmp/specfiles
o conf commit
test Some::Module        # specfile written to /tmp/specfiles
**Disable the plugin**
shell
o conf plugin_list pop    # if last
o conf commit
## See Also
- [CPAN::Plugin](http://localhost/phpMan.php/perldoc/CPAN%3A%3APlugin/markdown) — base class for CPAN shell plugins
- [CPAN](http://localhost/phpMan.php/perldoc/CPAN/markdown) — the CPAN shell