Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
autocode-cli
Advanced tools
Readme
Choose an Interface:
Use npm or Homebrew to install the Command-Line interface of Autocode:
npm install autocode-cli -g # most popular
brew install autocode # mac only
Use npm to install the JavaScript interface of Autocode:
npm install autocode-js
Choose the Hello World
tutorial for your Autocode installation:
If you've installed the Command-Line interface of Autocode, create a file called .autocode/config.yml
and add these contents:
name: My App
description: This is my app.
path: ./output/myapp
imports:
crystal/license: ~0.3.1
crystal/readme: ~0.5.1
outputs:
- generator: license.MITGenerator
spec:
copyright: 2015 Crystal
- generator: readme.ReadmeGenerator
spec:
name: $name
description: $description
Then use Autocode to build your project:
autocode build
View the output here.
If you've installed the JavaScript interface of Autocode, create a file called helloworld.js
and add these contents:
var Autocode = require('autocode-js');
var project = new Autocode({
name: 'My App',
description: 'This is my app.',
path: './output/myapp',
imports: {
'crystal/license': '~0.3.1',
'crystal/readme': '~0.5.1'
},
outputs: [{
// generate a LICENSE file
generator: 'license.MITGenerator',
spec: {
copyright: '2015 Crystal'
}
},{
// generate a README.md file
generator: 'readme.ReadmeGenerator',
spec: {
name: '$name',
description: '$description'
}
}]
});
Now run your helloworld.js
script:
node helloworld.js
View the output here.
Whether you've chosen the Command-Line interface or JavaScript interface, the output will be the same:
# My API
this is my API
The MIT License (MIT)
Copyright (c) 2015 Crystal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
crystal [command]
Commands:
build build project
config get project's Crystal Config
help get help
init initialize project
install <module> install module
run run project
search <module> search for modules
update update project's modules
var Autocode = require('autocode');
var project = new Autocode({
name: 'My App',
description: 'This is my app.',
path: './output/myapp',
imports: {
'crystal/license': '~0.2.4',
'crystal/readme': '~0.2.2'
},
outputs: [{
// generate a LICENSE file
generator: 'license.MITGenerator',
spec: {
copyright: '2015 Crystal'
}
},{
// generate a README.md file
generator: 'readme.ReadmeGenerator',
spec: {
name: '$name',
description: '$description'
}
}]
});
project.save();
var project = new Autocode('/path/to/project');
project.update();
project.build({
// overwrites any manual changes
force: true
});
project.run();
Modularize your project for other projects to use:
var mod = new Autocode({
name: 'My Module',
description: 'This is my module.',
path: './output/mymod',
imports: {
'crystal/handlebars': '~0.2.3'
},
exports: {
ReadmeGenerator: {
engine: 'handlebars.HandlebarsEngine',
filename: 'README.md',
schema: {
type: 'object',
properties: {
name: {
required: true,
type: 'string'
},
description: {
required: true,
type: 'string'
}
}
},
template: "# {{{name}}}\n\n{{{description}}}",
type: 'generator'
}
}
});
Builds your project.
Name | Type |
`force` | boolean |
var project = new Autocode('/path/to/project');
project.build({ force: true });
Generates your project's files.
Name | Type |
`force` | boolean |
var project = new Autocode('/path/to/project');
project.generate({ force: true });
Initializes your project.
var project = new Autocode('/path/to/project');
project.init({
name: 'My App',
description: 'This is my app.'
});
Installs a module.
var project = new Autocode('/path/to/project');
project.install({
'crystal/readme': '~0.2.2'
});
Loads your project's configuration.
var project = new Autocode;
project.load('/path/to/project');
Runs your project.
var project = new Autocode('/path/to/project');
project.run({ force: true });
Search for modules.
var project = new Autocode('/path/to/project');
project.search({ keywords: 'laravel' });
var project = new Autocode('/path/to/project');
project.test();
Test your project.
Updates your project.
var project = new Autocode('/path/to/project');
project.update();
Validates your project.
var project = new Autocode('/path/to/project');
project.validate();
View Crystal's Official Documentation here:
Use Crystal Editor to try Crystal online:
(1) Crystal unifies all technologies with a standardized input written in YAML, JSON, CSON and/or XML.
(2) Crystal generates code for:
(3) Crystal is made up of 8 elements that make code generation more flexible and powerful than ever before:
(4) Crystal is meant to be used on an ongoing basis - beyond project creation and scaffolding.
(5) Crystal has its own registry (the Crystal Hub) and package manager built-in which makes it easy to search, install and update modules.
(6) All of Crystal's elements can be modularized and published to the Crystal Hub for you or others to use.
(7) You can use multiple modules together such as a:
(8) You can add/remove modules to/from a project at anytime.
(9) To prevent vendor lock-in and becoming dependent of Crystal, it's kept in its own directory: .autocode/
. If you wish to no longer use Crystal, simply delete this directory and continue using the generated code (and making changes) without Crystal.
(10) Crystal makes language integration and/or migration easier.
FAQs
code automation for every language, framework and platform
The npm package autocode-cli receives a total of 9 weekly downloads. As such, autocode-cli popularity was classified as not popular.
We found that autocode-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.