git-coco 0.7.3 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -128,7 +128,7 @@ interface Config$1 {
128
128
  * @example 'openai/gpt-3.5-turbo'
129
129
  * @example 'huggingface/bigscience/bloom'
130
130
  **/
131
- service: Service;
131
+ service?: Service;
132
132
  /**
133
133
  * The OpenAI API key.
134
134
  */
@@ -1696,22 +1696,26 @@ async function createProjectFileAndReturnPath(fileName, contents) {
1696
1696
  }
1697
1697
 
1698
1698
  const handler = async (argv, logger) => {
1699
+ const options = loadConfig(argv);
1699
1700
  logger.log(LOGO);
1700
- const level = await select({
1701
- message: 'configure coco at the system or project level:',
1702
- choices: [
1703
- {
1704
- name: 'system',
1705
- value: 'system',
1706
- description: 'add coco config to your global git config',
1707
- },
1708
- {
1709
- name: 'project',
1710
- value: 'project',
1711
- description: 'add coco config to existing git project',
1712
- },
1713
- ],
1714
- });
1701
+ let level = options?.level;
1702
+ if (!level) {
1703
+ level = await select({
1704
+ message: 'configure coco at the system or project level:',
1705
+ choices: [
1706
+ {
1707
+ name: 'system',
1708
+ value: 'system',
1709
+ description: 'add coco config to your global git config',
1710
+ },
1711
+ {
1712
+ name: 'project',
1713
+ value: 'project',
1714
+ description: 'add coco config to existing git project',
1715
+ },
1716
+ ],
1717
+ });
1718
+ }
1715
1719
  let configFilePath = '';
1716
1720
  switch (level) {
1717
1721
  case 'project':
@@ -1853,7 +1857,14 @@ const handler = async (argv, logger) => {
1853
1857
  /**
1854
1858
  * Command line options via yargs
1855
1859
  */
1856
- const options = {};
1860
+ const options = {
1861
+ level: {
1862
+ type: 'string',
1863
+ alias: 'l',
1864
+ description: 'Configure coco at the system or project level',
1865
+ choices: ['system', 'project'],
1866
+ },
1867
+ };
1857
1868
  const builder = (yargs) => {
1858
1869
  return yargs.options(options);
1859
1870
  };
package/dist/index.js CHANGED
@@ -1717,22 +1717,26 @@ async function createProjectFileAndReturnPath(fileName, contents) {
1717
1717
  }
1718
1718
 
1719
1719
  const handler = async (argv, logger) => {
1720
+ const options = loadConfig(argv);
1720
1721
  logger.log(LOGO);
1721
- const level = await prompts$1.select({
1722
- message: 'configure coco at the system or project level:',
1723
- choices: [
1724
- {
1725
- name: 'system',
1726
- value: 'system',
1727
- description: 'add coco config to your global git config',
1728
- },
1729
- {
1730
- name: 'project',
1731
- value: 'project',
1732
- description: 'add coco config to existing git project',
1733
- },
1734
- ],
1735
- });
1722
+ let level = options?.level;
1723
+ if (!level) {
1724
+ level = await prompts$1.select({
1725
+ message: 'configure coco at the system or project level:',
1726
+ choices: [
1727
+ {
1728
+ name: 'system',
1729
+ value: 'system',
1730
+ description: 'add coco config to your global git config',
1731
+ },
1732
+ {
1733
+ name: 'project',
1734
+ value: 'project',
1735
+ description: 'add coco config to existing git project',
1736
+ },
1737
+ ],
1738
+ });
1739
+ }
1736
1740
  let configFilePath = '';
1737
1741
  switch (level) {
1738
1742
  case 'project':
@@ -1874,7 +1878,14 @@ const handler = async (argv, logger) => {
1874
1878
  /**
1875
1879
  * Command line options via yargs
1876
1880
  */
1877
- const options = {};
1881
+ const options = {
1882
+ level: {
1883
+ type: 'string',
1884
+ alias: 'l',
1885
+ description: 'Configure coco at the system or project level',
1886
+ choices: ['system', 'project'],
1887
+ },
1888
+ };
1878
1889
  const builder = (yargs) => {
1879
1890
  return yargs.options(options);
1880
1891
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-coco",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "zero-effort git commits with coco.",
5
5
  "author": "gfargo <ghfargo@gmail.com>",
6
6
  "license": "MIT",