Metadata-Version: 2.1
Name: coge
Version: 0.0.10
Summary: this is a description
Home-page: https://github.com/zk4/coge
Author: zk
Author-email: liuzq7@gmail.com
License: BSD
Download-URL: https://github.com/zk4/coge/archive/master.zip
Keywords: best practice for python project
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Requires-Python: >3.0.0
Description-Content-Type: text/markdown
Requires-Dist: pytest (==5.2.1)
Requires-Dist: setuptools (==40.6.3)

# coge

Simple yet powerful code generator.
Make use of existing tool as possiable as we can.

Compare to hygen, yo.
- yo is way too slow and complicated.
- hygen pollutes all template files, and only support ejs.

**What I only need:**
1. [x] template is runable as normal prj. No more \$placehold\$ stuff.
2. [x] instinct command with the power of fzf.
4. [x] quick project to template and vice versa.
3. [x] respect .gitignore.
3. [ ] support github.com repo.
5. write plugin in any language only if you can run it in shell.

# install
```
make install
```

# usage
```
export COGE_TMPLS="<your_template_folder>"
```

## 1
``` bash
coge js react oldkey:newkey :newkey0 :newkey1 @:destname 
```
What coge does:

- copy $COGE_TMPLS/js/react to $PWD/destname
- change all names from oldkey to newkey,  from  COGE_ARG__0 to newkey0 ,from  COGE_ARG__1 to newkey1

## 2
``` bash
coge js react
```
What coge does:
- Just copy $COGE_TMPLS/js/react to $PWD/app


# work with fzf
``` 
cg () {
	eval `coge -c $@ | fzf --preview= --bind 'enter:execute-silent(pbcopy <<< {})+abort' ` && pbpaste
}
```
call cg from terminal. and paste it.


# help
```
usage: coge [-h] [-a ARG_PREFIX] [-l] [-c] [-r] [-w] [-d DEPTH]
            [magic [magic ...]]

      make template link : cd x-engine-module-template && coge -r 
            use template : coge x-engine-module-template xxxx:camera @:x-engine-module-camera  


positional arguments:
  magic                 folder or newkey:oldkey

optional arguments:
  -h, --help            show this help message and exit
  -a ARG_PREFIX, --arg_prefix ARG_PREFIX
                        ex: COGE_ARG__
  -l, --list            list folders
  -c, --cmd             cmd
  -r, --link_tplt       link `cwd` to $COGE_TMPLS
  -w, --allow_git_dirty
                        alllow git dirty
  -d DEPTH, --depth DEPTH
                        list depth
```

